Hi,
I'm adding a decorator to a form element that has been attached to a form
with $form->addElement(). It's actually a decorator to handle some xhr
validation, and as such, has dependencies on another decorator attached to
the form (a toaster widget). I can add the form decorator manually in the
form, but I'd like to have it done automatically.
So what I want to do is add a decorator to the form from within the element
decorator, something like:
class My_XhrDecorator extends Zend_Form_Decorator_Abstract
{
public function render($content)
{
$element = $this->getElement();
$form = $element->getForm();
$form->addDecorator('myToasterWidgetDecorator');
... other stuff ...
return($content);
}
But there seems to be no way of accessing a form object from an attached
element object.
Is this possible? Is there a better way of handling dependent decorators
like this?
Thanks,
Mark
--
View this message in context:
http://www.nabble.com/Accessing-form-object-from-element-object--tp22825095p22825095.html
Sent from the Zend Framework mailing list archive at Nabble.com.