Prev | Current Page 40 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

* index.php #2
(annotation) <#1 Only continue if requested URL is not a file on disk.>
(annotation) <#2 Redirect request to index.php.>
Fortunately, this is not the most complicated set of Apache mod_rewrite rules and so can be easily
explained. The RewriteCond statement and the RewriteRule command between them instruct Apache to route
all requests to index.php unless the request maps exactly to a file that exists within the web_root/ directory
tree. This will allow us to serve any static resources placed in the web_root directory, such as JavaScript, CSS
and image files, whilst directing any other requests to our bootstrap file allowing the front controller to work
out what to display to the user.
2.5.3 Index Controller
The front controller pattern maps the URL requested by the user to a particular member function (the
action) within a specific controller class. This process is known as routing and dispatching. The controller
classes have a strict naming convention requirement in order for the dispatcher to find the correct function. The
router expects to call a function named {actionName}Action() within the {ControllerName}Controller class.
This class must be within a file called {ControllerName}.php. If either the controller or the action are not
provided, then the default used is index.


Pages:
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
pupa make up Athlete konstrukcje stalowe A*Teens q-power