Wednesday, 7 February 2007
New PHP Module Functions in Zend Framework |
| |
|
| |
Rob Allen in a new post over his blog, informs you about the new features to hit the Zend Framework since 0.7. These are Zend_Controller_ModuleRouter and its sibling Zend_Controller_ModuleRewriteRouter. This allows for separating out sets of controllers, models and views into their own modules. He explains and shows with code how the directory structure is and how to set it up in the index.php.
The module router then maps the first parameter of the URL to the module and then looks for a controller within that module's controller’s directory. He explains the process by using various URLs to implement it.
He points out an issue that in the directory layout, the controllers within the default route will need models and views too. As these are within the application directory itself and interspersed with the module directories, it will make it look untidy. He shows with an example how to create a directory called default to hold the three directories to make it look more organized.
He then confesses that he does not know how to handle an admin site. He tentatively uses the rewrite model router to make it work. He writes some code using his Integrated Development Environment(IDE). He uses the same model for news and adminNews and puts the admin code within the same set of directories.
|
| |
|
Read the Post
|
| |
|
|
| |
|
|
| |
|