Matthew Weier O'Phinney wrote: > To follow the conventional modular format, you should have the following > directory structure: > > APP_DIR/ > default/ > controllers/ > admin/ > controllers/ > (all controllers in this module should be prefixed with > 'Admin_')
I've seen so many descriptions of the "right" way to set up the directories that I'm not sure which is authoritative. Even the manual has different variants. It takes some time to figure out what is what. >> What do I need to do now to see exceptions? > > $controller->throwExceptions(true); Missed that. I guess I was stuck in the habit of doing $response->renderExceptions(true); > will turn off exception handling and throw them. However, the better way > is the error handler... more below. Caught that. There's so many changes that I'm quite confused. I was at the point where I pulled $controller->dispatch() in favor of ::run() (as a test). When I went back, I must have left out ->dispatch(). >> How do I map the default views to my setup of the controller? > > Please read the section on the conventional modular directory structure: > > http://framework.zend.com/manual/en/zend.controller.modular.html > > as well as the MVC quick start and the ViewRenderer documentation: > > > http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart.go > > http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.viewrenderer Again, so many variations - I'm all for that, but it takes a lot of effort to find out what the most standard (and convenient) approach is. > Use the directory structure as shown above, and add a views subdirectory > at the same level as 'controllers', with a subdirectory for view > scripts. Each controller then has a subdirectory itself: > > APP_DIR/ > default/ > controllers/ > IndexController.php > ErrorController.php > views/ > scripts/ > index/ > *.phtml > error/ > error.phtml > helpers/ > filters/ Great. I'd imagine a common (to all modules) filters/ and helpers/ directory would be useful as well, at least to help reduce duplication. I suppose I can add a path for generic helpers and filters. Of course, w/ helpers, that's how it was done from early on. It might be that I choose to not use the convenience methods provided by viewRenderer (or subclass it for different response types). My thoughts are that I would like to have: renderXhtml() (standard http headers, page header, body, page footer), renderPopup() (standard http headers, brief header, body, footer), renderPdf() (pdf headers, content), renderJpg() ... What are people doing to facilitate this kind of strategy? Thanks, -- Drew Thanks, -- Drew
