
The Definitive Guide to symfony symfony 1.2 This PDF is brought to you by License: GFDL Version: book-1.2-en-2010-07-29 Table of Contents ii Table of Contents Chapter 1: Introducing Symfony..................................................................... 10 Symfony in Brief ...................................................................................................... 10 Symfony Features............................................................................................................... 10 Who Made Symfony and Why? ........................................................................................... 11 The Symfony Community.................................................................................................... 12 Is Symfony for Me?............................................................................................................. 12 Fundamental Concepts ............................................................................................ 13 PHP 5.................................................................................................................................. 13 Object-Oriented Programming (OOP) ................................................................................ 13 Magic Methods................................................................................................................... 14 PHP Extension and Application Repository (PEAR) ........................................................... 14 Object-Relational Mapping (ORM) ..................................................................................... 15 Rapid Application Development (RAD)............................................................................... 16 YAML .................................................................................................................................. 17 Summary.................................................................................................................. 18 Chapter 2: Exploring Symfony’s Code............................................................. 19 The MVC Pattern ..................................................................................................... 19 MVC Layering..................................................................................................................... 20 Layer Separation Beyond MVC .......................................................................................... 23 Symfony’s MVC Implementation ........................................................................................ 26 Symfony Core Classes ........................................................................................................ 28 Code Organization ................................................................................................... 29 Project Structure: Applications, Modules, and Actions...................................................... 29 File Tree Structure ............................................................................................................. 29 Common Instruments .............................................................................................. 33 Parameter Holders ............................................................................................................. 33 Constants............................................................................................................................ 35 Class Autoloading............................................................................................................... 35 Summary.................................................................................................................. 35 Chapter 3: Running Symfony .......................................................................... 37 Installing the Sandbox ............................................................................................. 37 Installing the symfony Libraries .............................................................................. 38 Installing the symfony PEAR Package................................................................................ 39 Checking Out symfony from the SVN Repository .............................................................. 40 Setting Up an Application........................................................................................ 40 Creating the Project ........................................................................................................... 41 Creating the Application .................................................................................................... 41 Configuring the Web Server .................................................................................... 42 Setting Up a Virtual Host ................................................................................................... 42 Configuring a Shared-Host Server ..................................................................................... 43 Troubleshooting....................................................................................................... 45 Typical Problems ................................................................................................................ 45 ----------------- Brought to you by Table of Contents iii Symfony Resources ............................................................................................................ 45 Source Versioning.................................................................................................... 46 Summary.................................................................................................................. 47 Chapter 4: The Basics Of Page Creation......................................................... 48 Creating a Module Skeleton .................................................................................... 48 Adding a Page.......................................................................................................... 50 Adding an Action ................................................................................................................ 50 Adding a Template.............................................................................................................. 51 Passing Information from the Action to the Template ....................................................... 52 Linking to Another Action........................................................................................ 53 Getting Information from the Request .................................................................... 54 Summary.................................................................................................................. 55 Chapter 5: Configuring Symfony .................................................................... 56 The Configuration System ....................................................................................... 56 YAML Syntax and Symfony Conventions............................................................................ 57 Help, a YAML File Killed My App!...................................................................................... 60 Overview of the Configuration Files........................................................................ 61 Project Configuration ......................................................................................................... 61 Application Configuration .................................................................................................. 61 Module Configuration......................................................................................................... 63 Environments........................................................................................................... 64 What Is an Environment? ................................................................................................... 64 Configuration Cascade ....................................................................................................... 66 The Configuration Cache ......................................................................................... 68 Accessing the Configuration from Code .................................................................. 68 The sfConfig Class.............................................................................................................. 69 Custom Application Settings and app.yml ....................................................................... 70 Tips for Getting More from Configuration Files...................................................... 71 Using Constants in YAML Configuration Files................................................................... 71 Using Scriptable Configuration.......................................................................................... 71 Browsing Your Own YAML File .......................................................................................... 72 Summary.................................................................................................................. 73 Chapter 6: Inside The Controller Layer .......................................................... 74 The Front Controller................................................................................................ 74 The Front Controller’s Job in Detail ................................................................................... 74 The Default Front Controller.............................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages380 Page
-
File Size-