How can I replace the File decorator?

25 views Asked by At

I've tried doing it like this...

$element->removeDecorator( 'File');

$decorator = new Cms_Form_Decorator_ImageUpload;

// add to front of decorators
$decorators = $element->getDecorators();
array_unshift( $decorators, $decorator );
$element->setDecorators( $decorators );

But an exception get's thrown in Zend_Form_Element_File "file decorator found... unable to render file element"

1

There are 1 answers

0
thomas-peter On

The Cms_Form_Decorator_ImageUpload class needs to implement Zend_Form_Decorator_Marker_File_Interface.