Exemplo n.º 1
0
 public function configure()
 {
     $this->useFields(array('id', 'type', 'url', 'comment'));
     $this->widgetSchema['url'] = new sfWidgetFormInputText();
     $this->widgetSchema['url']->setAttributes(array('class' => 'small_medium_size'));
     /* Validators */
     $this->validatorSchema['id'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['url'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['comment'] = new sfValidatorString(array('trim' => true, 'required' => false));
     $this->mergePostValidator(new ExtLinksValidatorSchema());
     $this->widgetSchema['type'] = new sfWidgetFormChoice(array('choices' => ExtLinks::getLinkTypes()));
     $this->validatorSchema['type'] = new sfValidatorChoice(array('choices' => array_keys(ExtLinks::getLinkTypes())));
 }