Thanks a lot and sorry to answer so lately to your precious help - we
finally managed to generate the table header as we wished, based on your
last answer.
However, just in case, i want to precise that the sample you give us :
Tomoaki Kosugi wrote:
>
> --------
> $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;
> -------
>
The result is smthg like :
<th>label1</th>
<th><th>label1lable2</th></th>
<th><th><th>label1label2label3</th></th></th>
...
maybe you already now that - but just in case ;)
on our side, we finally ended with this working code :
at the beginning of the Render function :
$LabelDecorator = new Zend_Form_Decorator_Label();
$LabelItemsHtmlDecorator = new Zend_Form_Decorator_HtmlTag(array('tag' =>
'th'));
within the Render function, last orders of the foreach loop (where was the
original line : $items[] = $item->render(); ) :
$LabelDecorator->setElement($item);
$LabelItemsHtmlDecorator->setElement($item);
$items[] = $LabelItemsHtmlDecorator->render($LabelDecorator->render(''));
--
View this message in context: http://www.nabble.com/-ZF-1.7---Zend_Form--Header-for-a-table-tp22375408p22534044.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论