Is it bad idea to extend Zend_View and register like front controller plugin
Posted
by
user564325
on Stack Overflow
See other posts from Stack Overflow
or by user564325
Published on 2011-01-05T17:52:26Z
Indexed on
2011/01/05
17:53 UTC
Read the original article
Hit count: 265
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.
© Stack Overflow or respective owner