Beispiel #1
0
 /**
  * @param array $default
  */
 public function __construct(array $default = array())
 {
     parent::__construct();
     $this->configure();
     if (count($default)) {
         $this->setDefaults($default);
         $this->addSubmit('send', 'Edit')->setAttribute('class', 'btn-primary');
     } else {
         $this->addSubmit('send', 'Add')->setAttribute('class', 'btn-primary');
     }
     $this->onSuccess[] = $this->formSubmitted;
 }
Beispiel #2
0
 public function __construct(array $default = array())
 {
     parent::__construct();
     $this->configure();
     if (count($default)) {
         $this->setDefaults($this->prepareDefaultValues($default));
         $this->addSubmit('send', 'Edit post')->setAttribute('class', 'btn-primary');
     } else {
         $this->setDefaults(array('publish' => true));
         $this->addSubmit('send', 'Create post')->setAttribute('class', 'btn-primary');
     }
     $this->onSuccess[] = $this->formSubmitted;
 }