ZF-11760: setDecorators for a file element doesn;t work

Description

i am coding a zend form without using mvc. I am trying to add a file element and use the table , td and tr decorators. But this doesn't seem to work . What is the problem ? This is the code:


require_once 'Zend/Form.php';

class JobForm extends Zend_Form

{

       public function init()

       { 
          
          $this->setAction('index.php?apply='.$_GET['apply']) 

                         ->setMethod('post') 

                         ->setAttrib('id','myFormApply') 

                         ->setAttrib('enctype', 'multipart/form-data');

                         ;

                $coverLetter = $this->createElement('file','coverLetter')
 
                                     ->setLabel('Cover Letter*')

                                     ->setAttrib('id','coverLetter')
 
                                     ->setRequired(true)

                                     ->setDestination( './uploads') ;
                            
    
               $coverLetter->setDecorators(array(

                       'ViewHelper',

                       'Description',

                       'Errors',

                       array(array('data'=>'HtmlTag'), array('tag' => 'td')),

                       array('Label', array('tag' => 'td')),

                       array(array('row'=>'HtmlTag'),array('tag'=>'tr'))

               ));

                                
$submit = $this->createElement('button','submitApply')

->setAttrib('id','submitApply')

->setLabel('Submit'); 

                
$submit->setDecorators(array(

               'ViewHelper',

               'Description',

               'Errors', 

           array(array('data'=>'HtmlTag'), array('tag' => 
'td','colspan'=>'2','align'=>'center')),

               array(array('row'=>'HtmlTag'),array('tag'=>'tr'))

          ));

                                    
                    $this->addElement($coverLetter);
            
                    $this->addElement($submit); 
                    
    
                    $this->setDecorators(array(

                'FormElements',

                array('HtmlTag', array('tag' => 'table')),

                'Form'

                    ));

                    
        
                $this->addDecorator('Errors');

            
          
            
        }

        
}

Comments

Code tags added.

Please look at the FAQ: "Why can't Zend_Form render my File element without errors?"

http://framework.zend.com/about/faq

thanks that solved my issue