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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-22-2007, 05:07 PM
Junior Member
 
Join Date: Oct 2007
Posts: 2
Smile Using dashes in action names

Looks like I posted this post earlier in the wrong section, sorry. I tried searching for this answer before posting my question, and nothing came up.

My question is as follows: I want to make my script views have dashes in between their names, like "page/this-page.phtml". Now, in my "page" controller, how would I format the Action to use the "-" in the phtml file?

Thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-22-2007, 10:57 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 122
Default

The view will default to the action name, so your view files should be named after the action they are associated with.

If you need to render other views I believe you can do $this->view->render('this-page'); or in the view for that action $this->render('this-page'); it should append the .phtml by default. If your .phtml file is located in views/scripts/<controller name>/ you won't need the path. Otherwise you need to figure out the path and add that as so $this->view->render('path/to/this-page');

Be advised that there are several proposals that might change how this works, namely Zend_Layout. There is also a Xend_Layout which is different but similar to Zend_Layout. The view portion of the MVC is in a state of flux at the moment, most people are implementing a two-step view pattern or some derivative.

If the above examples don't work please paste your exception report and we'll figure it out.
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 01:23 AM.