Zend Framework Forum

Go Back   Zend Framework Forum > Zend Framework General discussions > General Q&A on Zend Framework

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-01-2009, 12:12 AM
Junior Member
 
Join Date: Dec 2008
Posts: 23
Default Setting zend form view scripts

Hey guys,
I've got a multipage form using zend_form, but I am having some problems with figuring out how to designate a view script from inside the form.
As its a multipage form using subforms, the are all controlled by the index action and thus using index.phtml.
However i need to upload photos in the second page so I am wanting the second form to render images.phtml, how do I do this?
I've tried various things inside zend_form such as:
[PHP]
public function init()
{
$view = new Zend_View();
$view->addScriptPath(APPLICATION_PATH . '/modules/app/views/scripts/listing/');
$view->render('process.phtml');

$this->addElement('submit', 'btnNext', array( 'label' => 'Next'));

}
[/PHP]
however it doesnt work, it simply continues to render index.phtml. Anyone have any suggestions?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-01-2009, 12:19 AM
Member
 
Join Date: Oct 2008
Posts: 65
Default

Set the view script inside the form by using loadDefaultDecorators().

[PHP]
public function init()
{
// add elements here
}

public function loadDefaultDecorators()
{
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'process.phtml'))
));
}
[/PHP]
__________________
Mark Belanger
http://www.shoreboat.com | http://twitter.com/shoreboat
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-01-2009, 04:50 AM
Junior Member
 
Join Date: Dec 2008
Posts: 23
Default

cheers that worked!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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:32 AM.


Designed by: Miner Skinz Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0