Example #1
0
 /**
  * @param string $name
  * @param string $label
  * @param string $namespace
  * @return MultiUpload
  * @throws FormException
  */
 public function addMultiImageUpload($name, $label, $namespace = NULL)
 {
     if (!class_exists(MultiUpload::class)) {
         throw new FormException('Install the extension via webchemistry/images.');
     }
     $control = new MultiUpload($label);
     $control->setNamespace($namespace);
     return $this[$name] = $control;
 }
Example #2
0
 public function testRegistration()
 {
     \WebChemistry\Images\Controls\MultiUpload::register();
     $form = new Form();
     $upload = $form->addMultiImageUpload('image');
     $this->assertInstanceOf('WebChemistry\\Images\\Controls\\MultiUpload', $upload);
 }