> Matthew Weier O'Phinney-3 wrote:
> You should create a custom decorator for that, then -- have it simply
> emit a <td></td> -- and attach it to that button.

I made a custom decorator and I'd like to use it as following:
$this->submit->setDecorators(array(
                        array(
                                'decorator' => 'ViewHelper',
                                'options' => array('helper' => 'formSubmit')),
                        array(
                                'decorator' => new my_decorator(), 
                                'options' => array('numColumns' => value, 
'placement' => value)),
                        array(
                                'decorator' => array('tr' => 'HtmlTag'),
                                'options' => array('tag' => 'tr')),
));

The problem is here that I need to pass my decorator a couple of values. How
many columns the table has and (if I ever want to use more than two) and if
where the button should display, in the first or in the second. I can't
modify the constructor of my decorator since that gives me a conflict with
the Zend_Form_Decorator_Interface. And if I add options like I did in my
example they aren't used since Zend_Form->addDecorator has this code:

if ($decorator instanceof Zend_Form_Decorator_Interface) {
            $name = get_class($decorator);
}

The options aren't passed to anything.

Is there any way around this?

> Pass the 'placement' => 'append' option to the Label decorator.
This works great, thanks.


-- 
View this message in context: 
http://www.nabble.com/How-render-Zend_Form-to-html-table--tp15299082p16731773.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to