Ah yes, that's not my day today ;)

Matthew Weier O'Phinney schrieb:
> -- Waldemar Schott <[EMAIL PROTECTED]> wrote
> (on Monday, 29 January 2007, 08:46 PM +0100):
>> I'm not sure, but i think you have to do this:
>>
>> echo Zend_Controller_Front::run(YOUR_CONTROLLERS_PATH);
>
> Just 
>
>     Zend_Controller_Front::run($controllerDir);
>
> No echo needed.
>
>> AFAIK the default behaviour is, that the dispatch() method only returns
>> the output without echoing. 
>
> Default behaviour is to render the response from dispatch().
>
>> It's possible to call Zend_Controller_Front::returnResponse(true); or
>> something like this.
>
> Doing this prevents dispatch() from rendering the response, and returns
> the response object, which you can then manipulate prior to rendering.
> If you do this, you can't use run(), but must use dispatch() instead.
>
>> 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.
>>>>
>

Reply via email to