I am so hopeless I started debugging the source.

When I am about to dispatch, in the 
"protected function _translateSpec($spec, array $vars = array())"
The variables have the following values :

$spec   :controller/:action.:suffix     
$controller     auth    
$action index   
$module partners    <=== AS you can see it finds the module I specify in
forward
$suffix phtml   
$moduleDir      ./application/modules\\partners 
$value  auth/index.phtml        

And in this method "$value" is returned, it doesn't seem to have the module
in it,
though the method finds the module partners.
So I thought maybe it's because of this $spec variable which doesn't take
module into the string,
but I looked into the different possible specs in the ViewRenderer.php and
there is only :
protected $_viewScriptPathNoControllerSpec = ':action.:suffix';
protected $_viewScriptPathSpec = ':controller/:action.:suffix';
protected $_viewBasePathSpec = ':moduleDir/views';





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#a12953858
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to