|
||||
|
Hello,
I am trying to use on same object multiple Template Systems with just one Zend_View (in fact derived from Zend_View_Interface) object. Sample: i want to use both Zend_View default template system and also Smarty (sample of using Smarty is here: Zend Framework) I don't want to create multiple Zend_View (or derived from Zend_View_Interface), because there are lot of data to be assigned to Zend_View (or similar) object... I am wondering if could be any problems when using multiple Template systems into same object ? Also, any tips for doing such Zend_View_Interface based class...
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
||||
|
It can be done by writing your own implemented Zend_View_Interface, but I wonder why this would be necessary?
Or you could extend the Zend_View class to include smarty. Another factor is you can chain parse the templates as I would assume you aren't passing the same data to both template engines? $view->data = test; $smarty->name = someName; $view->render($smarty->render(index.tpl));
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog Last edited by SpotSec : 03-27-2007 at 12:35 AM. |
|
||||
|
Hi and thanks for replies,
I am trying to simplify the use of view component due to fact i don't like too much to send lot of data to two views, and better to just one...
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
||||
|
Quote:
In this case you would just send the array to the view object and parse through it with Zend_View or your own template system. Here is the Zend_View example taken from the manual. PHP Code:
PHP Code:
. In that case sorry for the misunderstanding, could you rephrase your question?
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog Last edited by SpotSec : 03-28-2007 at 03:19 AM. |
|
||||
|
Quote:
If you really want to separate all php code, then you could use smarty or generate the html content within the controller (which basically defeats the mvc scheme)
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
|
||||
|
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
![]() |
| Thread Tools | |
| Display Modes | |
|
|