-- Lucas Roxo Mundim <[EMAIL PROTECTED]> wrote
(on Wednesday, 08 November 2006, 10:01 PM -0200):
> why this not work?
> 
> Zend_Controller_Front::run('./application/controllers');
> 
> All pages are routed to indexAction in the indexController.
> 
> I have tried this:
> $router = new Zend_Controller_RewriteRouter();
> $ctrl = Zend_Controller_Front::getInstance();
> $ctrl->setRouter($router);
> $ctrl->run('./application/controllers');
> 
> And I get:
> 
> Fatal error: Call to undefined method Zend_Controller_Front::getinstance()
> 
> I get that after upgraded from 0.1.5 to 0.2

Based on the above, it sounds like you're using the MVC implementation
in the incubator, as getInstance() was removed in that implementation.

The first example you gave (Zend_Controller_Front::run()) *should* run;
if it does not, please checkout the most current subversion revision and
try it. (I've tried a couple different variations on my local box, and
dispatching to different controllers works.)

For the second example, try this:

    $router = new Zend_Controller_RewriteRouter();
    $ctrl   = new Zend_Controller_Front();
    $ctrl->setRouter($router)
         ->setControllerDirectory('./application/controllers');
    $ctrl->dispatch();

Note that run() should not be used with an already instantiated object
instance; use dispatch() instead. Also, note that you need to set the
controller directory in a separate step; however, because fluid
interfaces were added in the new release, you can do several such setup
measures chained together, as shown above.

Finally, as reported earlier in this thread, it may be that the rewrite
router is having difficulty determining the rewrite base; if so,
explicitly set it prior to dispatching the front controller.

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

Reply via email to