I'm sorry.My sample is too simple to make table's row.
Because it represent a first possible step towards
the table's label-row renderring. It has only one decorator.
But this case,you need two or more decorators.
change it like this.
Accordingly, Zend_Form_Element::render()
--------
$decorators[] = new Zend_Form_Decorator_Label();
$decorators[] = new Zend_Form_Decorator_HtmlTag(array('tag' => 'th')));
$tmp = '';
foreach ($decorators as $decorator) {
$decorator->setElement($item);
$tmp = $decorator->render($tmp);
}
$items[] = $tmp;
-------
And if you don't mind, please brush up this,
Add setDecorators optionto __constructor.
, implement getDecorators() and
$decorators = $this->getDecorators();
thanks.
2009/3/10 lesquale <cedbourgeon@hotmail.com>:
>
> Thanks Tomoaki
>
> with your tip, i managed to create the first line of my form table like
> following code:
>
> <tr>
> <th> col1 label
> <th> col2 label
> </tr>
>
> i didn't find yet how to close tags
> of course it works well in this state but i'm not sure it will be w3c valid
>
>
> to put the <th> tag before the label, i change the separator line in
> formelements clone (plus the "item->render" line as you indicated)
> i think my way to manage <th> tag is a dirty way but it s the only one i
> found.
>
> may be u got an idea to do that.
> if not, i thank u all the same for ur time ;)
>
> Ced.
> --
> View this message in context: http://www.nabble.com/-ZF-1.7---Zend_Form--Header-for-a-table-tp22375408p22413436.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>
>
没有评论:
发表评论