Replace the label with these: array(array('labelTdClose'=>'HtmlTag'), array('tag'=>'td', 'closeOnly'=>true, 'placement'=>'prepend')), 'Label', array(array('labelTdOpen'=>'HtmlTag'), array('tag'=>'td', 'openOnly'=>true, 'class'=>'y_class', 'placement'=>'prepend')),
It looks weird because we're adding the tags backwards. If you want something that looks saner: 'Label', array(array('labelTd'=>'HtmlTag'), array('tag'=>'td', 'class'=>'y_class')), array(array('elemTdOpen'=>'HtmlTag'), array('tag'=>'td', 'openOnly'=>true, 'class'=>'x_class', 'placement'=>'append')), 'ViewHelper', 'Errors', 'Description', array(array('elemTdClose'=>'HtmlTag'), array('tag'=>'td', 'closeOnly'=>true, 'placement'=>'append')), array('Description', array('tag'=>'span')),// this is overrides the previous // Description. choose one or the other, // or use an alias on either. // if you place one here, it'd be a // direct child of TR, hence // invalid HTML array(array('row'=>'HtmlTag'), array('tag'=>'tr')) On Mon, Nov 3, 2008 at 5:58 PM, wenbert <[EMAIL PROTECTED]> wrote: > > THE DECORATOR: > ---------------------------------------------------- > $elementDecorators = array( > 'ViewHelper', //generates the > <input> tag > 'Errors', //appends > errors, if any > 'Description', //appends > description, if any > array('HtmlTag',array('tag' => 'td','class'=>'x_class')), //takes the > input, errors and description if any, prepends <td>, appends </td> > array('Label',array('tag' => 'td','class'=>'y_class')), //generates a > <label class="element">, wraps it in <td></td>, prepends it to the output > of > HtmlTag > array('Description', array('tag' => 'span')), > array(array('row' => 'HtmlTag'), array('tag' => 'tr')));//wraps the > whole thing in <tr></tr> > > HTML OUTPUT: > ----------------------------------------------------- > <tr> > <td> > <label class="y_class required" for="emp_id">Employee ID:</label> > </td> > <td class="x_class"> > <input id="emp_id" class="normal_text_box ui-autocomplete-input" > type="text" > value="" name="emp_id" autocomplete="off"/> > </td> > </tr> > > THE QUESTION: > ------------------------------------------------------ > See "y_class" - to my understanding, y_class should be inside the <td> > wrapping the <label>-tag. > Can someone explain to me how to put the "y_class" inside the first <td>? > > DASPRID suggested that I use CSS Selectors like: > /* css for the first TD */ > .tr_form tr td:first-child { > background-color: #ccc; > } > > /* css for the second TD */ > .tr_form tr td+td { > background-color: #000; > } > ...but i have users who are still using IE6. I still would like to find out > how to add the y_class using the decorators ;) > > ----- > http://blog.ekini.net > -- > View this message in context: > http://www.nabble.com/Zend_Form-Decorators%2C-tried-to-add-parameters---unexpected-HTML-output-tp20299943p20299943.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- -- Mon