Ejemplo n.º 1
0
 public function __construct(array $field = array())
 {
     parent::__construct($field);
     $this->_model = Arr::get($field, 'model', $this->_model);
     $this->_rows = ORM::factory($this->_model)->find_all();
     $this->_name_column = Arr::get($field, 'name_column', $this->_name_column);
 }
Ejemplo n.º 2
0
 public function __construct($field)
 {
     parent::__construct($field);
     if (empty($this->_value)) {
         $this->_value = serialize(array());
     }
     $this->_validate = Validate::factory(array());
     foreach (Arr::get($field, 'fields', array()) as $name => $cfg) {
         if (is_null($cfg)) {
             $cfg = 'text';
         }
         if (!is_array($cfg)) {
             $cfg = array('type' => $cfg);
         }
         $this->_fields[$name] = Extasy_Form_Field::factory($cfg);
         $this->_fields[$name]->set_name($name . '_add_element');
         $this->_rules[$name] = Arr::path($field, 'rules.' . $name, array());
         $this->_labels[$name] = Arr::path($field, 'labels.' . $name, Inflector::humanize($name));
         $this->_validate->rules($name, $this->_rules[$name]);
         $this->_validate->label($name, $this->_labels[$name]);
     }
 }
Ejemplo n.º 3
0
 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->attrs['type'] = 'text';
 }
Ejemplo n.º 4
0
 public function __construct(array $field = array())
 {
     parent::__construct($field);
     $this->_upload_dir = Arr::get($field, 'upload_dir', $this->_upload_dir);
     $this->_old_value = $this->_value;
 }
Ejemplo n.º 5
0
 protected function __construct(array $field = array())
 {
     $this->_options = Arr::get($field, 'options', $this->_options);
     parent::__construct($field);
 }