2008年9月24日星期三

Re: [fw-mvc] Zend_Form_Decorator_ViewScript

-- Nayef Abu Ebaid <nayefae@gmail.com> wrote
(on Tuesday, 23 September 2008, 04:05 PM -0700):
> I am using Zend_Form to create an upload form, my form works fine without
> using the ViewScript Decorator, but I want to give the ViewScript decorator
> a try since it provides a control over the elements, but I got this error
> (Warning: No view script registered with ViewScript decorator) and I am not
> able to figure out the solution. here is my code:

<snip to the relevant part>

> $form->setDecorators( array( array('ViewScript',
> array('ViewScript' => 'uploadForm.phtml'))));

You want to use the array key "viewScript" -- note the case.

Alternately, you can set the viewScript property of the form object:

$form->setAttrib('viewScript', 'uploadForm.phtml');

Finally, make sure that the referenced view script is in the view script
paths.

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: