コード例 #1
0
ファイル: Json.php プロジェクト: symforce/symforce-admin
 public function getFormOptions()
 {
     $options = parent::getFormOptions();
     $writer = new \Symforce\AdminBundle\Compiler\Generator\PhpWriter();
     $writer->writeln('new \\Symforce\\AdminBundle\\Form\\Constraints\\Json(array(')->indent()->outdent()->writeln('))');
     $options['constraints'][] = $this->compilePhpCode($writer->getContent());
     return $options;
 }
コード例 #2
0
ファイル: Html.php プロジェクト: symforce/symforce-admin
 public function getFormOptions()
 {
     $admin_class = $this->admin_object->getCompileClass();
     $admin_class->addLazyArray('form_elements', $this->class_property, array('ext' => $this->extentions, 'max' => $this->max_size, 'image' => $this->image, 'video' => $this->video, 'doc' => $this->doc));
     $this->admin_object->generator->setDoctrineConfig($this->admin_object->class_name, 'html', $this->class_property);
     $options = parent::getFormOptions();
     $options['sf_admin_class'] = $this->admin_object->class_name;
     $options['sf_admin_property'] = $this->class_property;
     $options['sf_admin_name'] = $this->admin_object->name;
     $options['sf_admin_id'] = $this->admin_object->property_id_name;
     $options['html_options'] = array('image' => $this->image, 'video' => $this->video, 'doc' => $this->doc);
     if (null !== $this->valid_elements) {
         $options['html_options']['valid_elements'] = $this->valid_elements;
     }
     if (null !== $this->extended_valid_elements) {
         $options['html_options']['extended_valid_elements'] = $this->extended_valid_elements;
     }
     $options['attr']['rows'] = 20;
     return $options;
 }