|
|||
|
I currently have 4 controllers, each with the same set (4) of actions. The view scripts for each action is basically the same across different controllers, and I'd like to avoid having 16 scripts in 4 different folders. The view script structure is (the standard setup):
views/scripts/controller1/actions 1 - 4 views/scripts/controller2/actions 1 - 4 views/scripts/controller3/actions 1 - 4 views/scripts/controller4/actions 1 - 4 What I would like to have is: views/scripts/actions 1 - 4 I know I can just add $this->render('action', null, true); to each action, but that seems a little unnecessarily repetitive. How else can I do this? I feel like I've missed something in the documentation, but I just can't see where the controller name is added to the script path, or how to avoid that happening. Thank in advance for any help ![]() |
|
|||
|
Place the code below in your bootstrap and it should work the way you want it to.
This would affect all of your controllers tho. Maybe that is not what you are after. $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); $viewRenderer->setViewScriptPathSpec(':action.:suffix'); Zend_Controller_Action_HelperBroker::addHelper($vi ewRenderer); |
|
|||
|
|
|
|||
|
Thank you!
![]()
__________________
Nắng sớm nhớ cha nợ cha một sự nghiệp Chiều ta thương mẹ nợ mẹ một nàng dâu ---------------------------- Diễn đàn Nghệ An - Hà Tĩnh: http://nghe-online.org/forum |
![]() |
| Thread Tools | |
| Display Modes | |
|
|