Indeed in the preDispatch it works great !
Also in the doc it is specified that forward is working in preDispatch,
postDispatch and any action methods. So it does not mention 'init'.
But the exception I had is really misleading.
Anyway,
Thank you   :-)


Matthew Weier O'Phinney-3 wrote:
> 
> -- debussy007 <[EMAIL PROTECTED]> wrote
> (on Saturday, 29 September 2007, 05:01 AM -0700):
>> I found my bug ...
>> 
>> It's because I do a forward in the init method.
>> 
>> Actually in each init method I checked for specific ACL rights.
>> If the user requesting the page had not the correct ACL rights, I forward
>> him to the login page.
>> 
>> Well i tested  to move the forward instruction in the actions of my
>> controllers, and now it seems to work ...
> 
> You can call _forward() anywhere from preDispatch() onwards. init() is
> usually a bad place to do so, however.
> 
>> 
>> debussy007 wrote:
>> > 
>> > Hello,
>> > 
>> > Whenever I try to forward to another module, 
>> > it keep trying to find the action/controller inside the current module.
>> > It's like it doesn't consider the third parameter of _forward method,
>> > which specifies the module.
>> > 
>> > e.g. with this code in the "default" module : 
>> > 
>> > $this->_forward('index','auth','partners');
>> > return;
>> > 
>> > I have the following error : 
>> > 
>> > Uncaught exception 'Zend_View_Exception' with message 'script
>> > 'auth/index.phtml' not found in path
>> > (.\application\modules\default\views\scripts\)'
>> > 
>> > As you see it tries to find the action/controller in default module,
>> even
>> > if I specified to find it in the "partners" module.
>> > 
>> > My application structure is the following :
>> > 
>> > - application
>> > |-- modules
>> >     |--- admin
>> >            |--- controllers
>> >            |--- models
>> >            |--- views
>> >     |--- default
>> >            |--- controllers
>> >            |--- models
>> >            |--- views
>> >     |--- partners
>> >            |--- controllers
>> >            |--- models
>> >            |--- views
>> > 
>> > I have the following in my bootstrap :
>> > 
>> > error_reporting(E_ALL|E_STRICT);
>> > date_default_timezone_set('Europe/Brussels');
>> > ini_set('display_errors', true);
>> > ini_set('include_path', ini_get('include_path') 
>> >    . PATH_SEPARATOR . './library'
>> >    . PATH_SEPARATOR . './application/modules/default/models/'
>> >    . PATH_SEPARATOR . './application/modules/partners/models/'
>> >    . PATH_SEPARATOR . './application/helpers/');
>> > [...]
>> > $front = Zend_Controller_Front::getInstance();
>> > $front->addModuleDirectory('./application/modules');
>> > $front->setBaseUrl($config->baseUrl);
>> > if($config->test) 
>> >    $front->throwExceptions(true);
>> > $front->dispatch();
>> > 
>> > Thank you for any help!
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Forward-to-another-module-doesn%27t-work-tf4526568s16154.html#a12954854
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>> 
> 
> -- 
> Matthew Weier O'Phinney
> PHP Developer            | [EMAIL PROTECTED]
> Zend - The PHP Company   | http://www.zend.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Forward-to-another-module-doesn%27t-work-tf4526568s16154.html#a12975254
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to