I just ask, is it bad idea to extend Zend_View and register like Front Controller plugin after router is ready, because i need, $request to get active module name to show Zend_View where are my templates ?
public function routeShutdown(Zend_Controller_Request_Abstract $request){
$view = new View($config, $request);
$viewHelper = new Zend_Controller_Action_Helper_ViewRenderer($view);
Zend_Controller_Action_HelperBroker::addHelper($viewHelper);
}
And after that i get $request->getModuleName(); and make the my ScriptPaths
I have tried this method
$viewHelper->setViewScriptPathSpec(':controller/:action.:suffix')
But can’t work.
It’s not necessary to extend View.
You could create controller action plugin which will assign request to View initialized by application resource plugin Zend_Application_Resource_View. But assign only what is necessary (module name) and not full request – for security.