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.

Reply via email to