php - How to add attribute for outermost decorator? -


hope can shed light on this:

i have decorator wraps tr/td tags on various elements. far, good. however, have 'break' element, puts in blank area on form grouping.

this has following php:

public $elementbreakdecorator = array(     'viewhelper',     'errors',     array(array('data' => 'htmltag'), array('tag' => 'td', 'class' => 'form_break')),     array('label', array('tag' => 'td', 'colspan'=> '4')),     array(array('row' => 'htmltag'), array('tag' => 'tr')) ); 

used follows:

$this->addelement('hidden', 'break', array(     'decorators' => $this->elementbreakdecorator,     'label' => 'optional text break element')             ); 

and generated following markup:

<tr>     <td id="break-label">         <label for="break" colspan="4" class="optional">optional text break element</label>     </td>     <td class="form_break">         <input type="hidden" name="break" value="" id="break" />     </td> </tr> 

what need though, colspan appear in break-label tag, not label tag. have tried different arrangements can't place want.

anybody got idea of i'm missing?

note:
similar 5332832, tagclass writes class=xx tag. other answers don't work.

personally, remove label decorator , add prepend custom decorator.

here website (wiip.fr) allowed me know technique (in french examples clear), otherwise, found it.there others :)

hope works you. :)


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -