Prev | Current Page 48 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

Thus the code:
$items = $request->getParam('items');
will work unchanged when run as a web request or as a command line script.
In general, The request object should be treated as read only to the application as, implicitly, the values set
by the user shouldn??™t be changed. Having said that, Zend_Controller_Request_Http also contains parameters
which can be set in the start up phase of the application and then retrieved by the action functions as required.
This can be used for passing additional information from the front controller to the action functions if required.
Routing
Routing is the process of determining which controller??™s action needs to be run in order to satisfy the request.
This is performed by a class that implements Zend_Controller_Router_Interface and the framework supplies
Zend_Controller_Router_Rewrite which will handle most routing requirements. Routing works by taking the
part of the URI after the base URL (known as the URI endpoint) and decomposing it into separate parameters.
For a standard URL such as http://example.com/index.php?controller=news&action=list the decomposition is
done by simply reading the $_GET array and looking for the ???controller??™ and ???action??™ elements. As a modern
framework, it is expected that most applications built using the Zend Framework will use pretty URLs of the
form http://example.


Pages:
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
szkolenia dla przedsiębiorców oferty spa Wczasy nad morzem projektowanie wnętrz opony michelin