On 11/26/2011 02:03 PM, Razorblade wrote:
Hi,
try also this solution:

protected $_formElementDecorators = array(
     'ViewHelper',
     array( 'Errors', array('escape' =>  false, 'placement' =>  'append' ) ),
     array( array( 'containerDD' =>  'HtmlTag' ), array('tag' =>  'dd') ),
     array( 'Label', array('tag' =>  'dt', 'escape' =>  false ) ),
     array( array('row' =>  'HtmlTag'), array('tag' =>  'dl' ) ),
);

It's the same solution of Wil Revehl, but adds error management.
The error tag, if any, will be rendered right after the "input" html tag.

You must call
$this->setElementDecorators($this->_formElementDecorators);
after you defined all your elements.

The properties of the Errors decorator ( array('escape' =>  false,
'placement' =>  'append' ) ) are there just to let you know they exists.

Hope it helps.

Razorblade, Wilson Revehl,

Helpful and insightful.

I now have this...

   $subForm->setElementDecorators(array(
       array(array('dd' => 'HtmlTag'), array('tag' => 'dd')),
       array(array('dt' => 'Label'),   array('tag' => 'dt')),
       array(array('dl' => 'HtmlTag'), array('tag' => 'dl')),
   ));
   $subForm->setDecorators(array(
       array('elem' => 'FormElements'),
       array('form' => 'Form'),
       array('fset' => 'Fieldset'),
   ));

... which gives perfect markup.

Problem is the <dt><label> tag is fully populated but the corresponding <dd> is empty.

The labels are there, where are the matching form elements?


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


Reply via email to