Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-09-2008, 09:25 PM
Junior Member
 
Join Date: Jan 2008
Location: Chattanooga area
Posts: 8
Default Zend_Layout with Zend_View_Smarty

I have my rendition of My_View_Smarty running just fine, and would now like to implement the Zend_Layout with it. When I add Zend_Layout, it throws an error

Fatal error: Call to undefined method My_View_Smarty::addScriptPath() in /path/to/_library/Zend/Layout.php on line 725

I am using the My_View_Smarty (replacing My for Zend) from the ZendView documentation as it is (except the 'My' replacement) and as such there is no method called addScriptPath(). I thought of simply adding one and just doing a parrent::addScriptPath($path) within it, but this extension uses the setScriptPath to set the template directory for Smarty, and I am not sure that is what the original did, so it might not be what should be done in an addScriptPath method.

Any thoughts about what this addScriptPath should do in a situation where adding the Layout functionality to a view based on Smarty?

Thanks for taking the time to consider this. I look forward to all suggestions.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-12-2008, 04:57 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default

Quote:
Originally Posted by StevenHill View Post
I have my rendition of My_View_Smarty running just fine, and would now like to implement the Zend_Layout with it. When I add Zend_Layout, it throws an error

Fatal error: Call to undefined method My_View_Smarty::addScriptPath() in /path/to/_library/Zend/Layout.php on line 725
Did you try creating a new view?

$layout = new Zend_Layout();

$layout->addScriptPath();

something like that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-13-2008, 12:37 AM
Junior Member
 
Join Date: Jan 2008
Location: Chattanooga area
Posts: 8
Default

Quote:
Originally Posted by notrub225 View Post
Did you try creating a new view?

$layout = new Zend_Layout();

$layout->addScriptPath();

something like that?
I tried every way in the documentation. I spent a good bit of time on it and I think that at this point I have come to the conclusion that all the pieces under 1.5 have not come together yet, and, with Smarty only having one template path that the concept of adding a path does not fit. I did try to simply replace the path with a new path pointing to the layout.tpl file presuming that it would then just render the layout.tpl with the view's template (actionName.tpl) just being rendered into the $content variable in the layout. But, it seems that all the methods required to do that are part of the view, and creating a smarty_view that implements the view_interface seems to mean that the only methods available are the one defined in the smarty_view, and those are not there. I started out with a solution that extended the view_abstract, but over time was pointed at the implementation solution as being the proper way to do smarty.

I am not sure what would be the best way, all of this ZF stuff is new to me and I do not have the time to try to work it out. I am now doing this without layout at this point, using include files to handle typical layout segments. I may go back to this later, in a refactoring phase.

Thanks for the thoughts though.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:04 PM.