-- Drew Bertola <[EMAIL PROTECTED]> wrote
(on Sunday, 15 July 2007, 09:57 PM -0700):
> I've already done a few projects with ZF in the range of 0.2 through 0.9
> or so, but this is the first time I've tried to run 1.0.
> 
> My problem is that I'm not getting any output, either good or bad.
> 
> I've spent a few hours going through the manual, but it doesn't seem to
> address the points I need in order to move further on.
> 
> What I'm trying to do is use something like this:
> 
> 
> $controller = Zend_Controller_Front::getInstance();
> 
> $controller->setControllerDirectory(
>   array("default"  => APP_DIR . "controllers/default",
>         "admin"    => APP_DIR . "controllers/admin")
>   );

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_')

> What do I need to do now to see exceptions?

    $controller->throwExceptions(true);

will turn off exception handling and throw them. However, the better way
is the error handler... more below.

> 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

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/

> Where does ErrorController live (in
> ./controllers/default/ErrorController.php was my guess)?

In your setup, yes; though I encourage you to use the now established
conventions.

Look at the ErrorHandler documentation for better examples of how to
handle application exceptions, and turn off throwExceptions():

    
http://framework.zend.com/manual/en/zend.controller.plugins.html#zend.controller.plugins.standard.errorhandler

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to