12.07.2015 Views

A Gentle Introduction to symfony (pdf) - Bad Request

A Gentle Introduction to symfony (pdf) - Bad Request

A Gentle Introduction to symfony (pdf) - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Table of ContentsiiiDirec<strong>to</strong>ry Structure Rights ................................................................................................. 42Web Server Configuration ....................................................................................... 43The ugly Way ...................................................................................................................... 43The secure Way .................................................................................................................. 43Using the Sandbox................................................................................................... 46Summary.................................................................................................................. 47Chapter 4: The Basics Of Page Creation......................................................... 48Creating a Module Skele<strong>to</strong>n .................................................................................... 48Adding a Page.......................................................................................................... 50Adding an Action ................................................................................................................ 50Adding a Template.............................................................................................................. 51Passing Information from the Action <strong>to</strong> the Template ....................................................... 52Linking <strong>to</strong> Another Action........................................................................................ 53Getting Information from the <strong>Request</strong> .................................................................... 54Summary.................................................................................................................. 55Chapter 5: Configuring Symfony .................................................................... 56The Configuration System ....................................................................................... 56YAML Syntax and Symfony Conventions............................................................................ 57Help, a YAML File Killed My App!...................................................................................... 60Overview of the Configuration Files ........................................................................ 61Project Configuration ......................................................................................................... 61Application Configuration .................................................................................................. 61Module Configuration......................................................................................................... 63Environments........................................................................................................... 64What Is an Environment? ................................................................................................... 64Configuration Cascade ....................................................................................................... 66The Configuration Cache ......................................................................................... 68Accessing the Configuration from Code .................................................................. 69The sfConfig Class .......................................................................................................... 69Cus<strong>to</strong>m Application Settings and app.yml ....................................................................... 70Tips for Getting More from Configuration Files ...................................................... 71Using Constants in YAML Configuration Files ................................................................... 71Using Scriptable Configuration.......................................................................................... 72Browsing Your Own YAML File .......................................................................................... 72Summary.................................................................................................................. 73Chapter 6: Inside The Controller Layer .......................................................... 74The Front Controller................................................................................................ 74The Front Controller’s Job in Detail ................................................................................... 74The Default Front Controller.............................................................................................. 75Calling Another Front Controller <strong>to</strong> Switch the Environment ........................................... 75Actions ..................................................................................................................... 76The Action Class ................................................................................................................. 76Alternative Action Class Syntax ......................................................................................... 77Retrieving Information in the Action.................................................................................. 78Action Termination ............................................................................................................. 79Skipping <strong>to</strong> Another Action ................................................................................................ 81Repeating Code for Several Actions of a Module............................................................... 82Accessing the <strong>Request</strong>............................................................................................. 83User Session ............................................................................................................ 84Accessing the User Session................................................................................................ 84Flash Attributes.................................................................................................................. 86Session Management.......................................................................................................... 86----------------- Brought <strong>to</strong> you by

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!