Dmity,
I'm not sure, but i think you have to do this:
echo Zend_Controller_Front::run(YOUR_CONTROLLERS_PATH);
AFAIK the default behaviour is, that the dispatch() method only returns
the output without echoing. It's possible to call
Zend_Controller_Front::returnResponse(true); or something like this.
Dmity Sinev schrieb:
> Hi!
>
> You can do this by defining your own route for example like this:
>
> $router = new Zend_Controller_RewriteRouter();
>
> $router->addRoute(
> 'default',
> new Zend_Controller_Router_Route(':action/:subnavi/',
> array('controller' => 'YourDefaultController' , 'action' =>
> 'YourDefaultAction', 'subnavi' => 'YourDefaultSubnavi'))
> );
>
> $front->setRouter($router);
>
> // Instead this 2 lines should be just
> Zend_Controller_Front::run(PATH_YOUR_CONTROLLERS), but it's not
> working.... why?
> $front->setControllerDirectory(PATH_YOUR_CONTROLLERS);
> $front->dispatch();
>
> Now, when you request this url http://www.example.org/mainnavi/subnavi
> you will get:
> controller = YourDefaultController
> action = mainnavi
> subnavi = subnavi
>
> This approach is suitable only for very small sites...
>
> For more information please read this:
> http://framework.zend.com/manual/en/zend.controller.providedsubclasses.html#zend.controller.providedsubclasses.rewriterouter
>
>
> On 29.01.2007, at 17:37, Ivan Ruiz Gallego wrote:
>
>> Hello,
>>
>> This is my very simple question:
>> I would like to route URL's like
>> "http://www.example.org/mainnavi/subnavi" to a single controller that
>> renders the appropriate content depending on "mainnavi" and
>> "subnavi". I would like to avoid writing one controller for each main
>> navigation point. Which is the appropriate way to do this within Zend
>> Framework? Or do you think that the whole approach is unappropriate?
>> Thank you.
>>
>> Regards,
>> Ivan.
>>
>