Hello guys,
I'm working now on a project that is made with ZF and Smarty and i have following issue: If i implement different modules in my application is easy for me to add the controllers in the front controller, but when i have to add also the view folders i saw that Smarty accepts only one folder as view.
Does anyone has found an workaround for this problem?
Zend_Framework and Smarty, view problem
Moderator: General Moderators
-
BornForCode
- Forum Contributor
- Posts: 147
- Joined: Mon Feb 11, 2008 1:56 am
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Zend_Framework and Smarty, view problem
Moved to PHP - Code.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Zend_Framework and Smarty, view problem
Can you manage view routes at all in the ZF? (I have no real experience with it so I am not sure if you can or not).
-
BornForCode
- Forum Contributor
- Posts: 147
- Joined: Mon Feb 11, 2008 1:56 am
Re: Zend_Framework and Smarty, view problem
You can, taking from example the module name, but in this case the smarty is the problem, i wish that they implement multiple folder support for their template_dir parameter.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Zend_Framework and Smarty, view problem
I think the template_dir can be changed prior to parsing the view. Have you tried just resetting the template_dir property before calling the display() method (or whatever methods triggers the parse)?
-
BornForCode
- Forum Contributor
- Posts: 147
- Joined: Mon Feb 11, 2008 1:56 am
Re: Zend_Framework and Smarty, view problem
yes, you can change it in the init function from example (located in the controller) but i was looking for an embedded solution, perhaps i'm to lazy 
Re: Zend_Framework and Smarty, view problem
yep, too lazy 
In manual there is full implementation of
class Zend_View_Smarty implements Zend_View_Interface
http://framework.zend.com/manual/en/zen ... ripts.html
With little tweak you can make it work. You can then setScriptPath() on preDispatch of controller action helper ... (knowing the module, controller,action) to be executed you can easily can adjust where to look for templates
In manual there is full implementation of
class Zend_View_Smarty implements Zend_View_Interface
http://framework.zend.com/manual/en/zen ... ripts.html
With little tweak you can make it work. You can then setScriptPath() on preDispatch of controller action helper ... (knowing the module, controller,action) to be executed you can easily can adjust where to look for templates