/**
  * Seed the form with defaults that are stored in the session
  *
  * @param FormBuilder $fb
  */
 public function onBuildForm(FormBuilder $fb)
 {
     foreach ($fb->getElements() as $element) {
         if (!$element instanceof FileElement) {
             continue;
         }
         if (!$fb->getAttribute('enctype') == 'multipart/form-data') {
             $fb->attr('enctype', 'multipart/form-data');
         }
     }
 }
Exemple #2
0
 public function testGetAttribute()
 {
     $this->assertSame('POST', $this->fb->getAttribute('method'));
     $this->assertNull($this->fb->getAttribute('non-existing'));
 }