Thanks, Alexander

When switching to modules everything is on track again - your suggestions worked, and I could get it running again.

However, I still miss the functionality that 0.8.0 had, which enabled me to add multiple directories that will be searched for controllers.

I'm going to start a new thread to address this specific issue, as the current issue I was having was solved by using the predefined modular structure.

Thank you,
Werner


Alexander Netkachev wrote:


On 3/21/07, *Werner* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hello, fellow ZF users

    I ran into trouble with setControllerDirectory() when switching from
    0.8.0 to 0.9.0Beta.

    The following worked fine in 0.7.0 to 0.8.0:
    ----------------
        $frontController->setControllerDirectory(
            array(
                './src/admin/con',
                './src/con'
            )
        );

        $routePageHandler = new Zend_Controller_Router_Route(
            ':section/:task/:identifier/:subidentifier',
            array(
                'section'       => 'home',
                'task'          => 'view',
                'identifier'    => '',
                'subidentifier' => '',
                'controller'    => 'page',
                'action'        => 'index'
            )
        );
        $router->addRoute('*', $routePageHandler);

        $routeAdminHandler = new Zend_Controller_Router_Route(
            'admin/:section/:task/:identifier/:subidentifier',
            array(
                'section'       => 'login',
                'task'          => 'view',
                'identifier'    => '',
                'subidentifier' => '',
                'controller'    => 'admin',
                'action'        => 'admin'
            )
        );
        $router->addRoute('admin', $routeAdminHandler);

        $frontController->setRouter($router);
        $frontController->dispatch();
    ----------------


    I changed the setControllerDirectory params to the following in 0.8.0,
    and it still seemed to work:
    ----------------
        $frontController->setControllerDirectory(
            array(
                'default' => './src/con',
                'admin'   => './src/admin/con'
            )
        );
    ----------------


1. The code above specifies that you have two modules 'default' and 'admin'. So you have controllers of /src/admin/con in admin module. That also means that controllers class names should be prefixed with Admin_, e.g. Admin_IndexController so please check this.

2. I think that you have the error because $routeAdminHandler does not specify a module the request should be passed to. So, the 'default' is used, not 'admin'. Just add 'module' => 'admin' to the parameters.


Sincerely,

--
Alexander
http://www.alexatnet.com/ - Blog and CMS created with Zend Framework and Ajax.

Reply via email to