On 11/28/2011 06:26 AM, Wilson Revehl (Go Media Inc.) wrote:
I recommend creating a form wide decorator that meets the need of each element. 
Here's an example:

class Core_Form_NewAccount extends ZF_form
{

     public $textDecorators = array('ViewHelper', array(array('data' =>  'HtmlTag'), 
array('tag' =>  'dd')), array('Label', array('tag' =>  'dt')), array('HtmlTag', 
array('tag' =>  'dl')));

  $this->addElement('text', 'fname', array(
        'label' =>  '*First Name',
                 'required'    =>  true,
                 'decorators' =>  $this->textDecorators
         ));

You may need to use 'decorators' =>  self::$textDecorators if it is a real subForm but 
other than that, not sure why you'd have an issue. There should "decorate", 
therefore build onto the output of your form class.


Bingo!  The picture becomes clearer...

Thanks to that I now have a subform decorator that renders forms into tables with a selectable number of columns and which uses javascript to add and delete rows.

Thanks for all your help, Wil!

Mike

--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to