Example #1
0
 function form($form = null, $params = [])
 {
     if ($form === null) {
         return Form::getInstance();
     }
     return Form::make($form, $params);
 }
Example #2
0
File: Input.php Project: werx/forms
 /**
  * @param null $name
  * @param null $id
  */
 public function __construct($name = null, $id = null)
 {
     Form::getInstance();
     if ($id == null) {
         $id = preg_replace('/[^0-9A-Za-z_-]*/', '', $name);
     }
     $this->attribute('name', $name);
     if ($id !== false) {
         $this->attribute('id', $id);
     }
     return $this;
 }
Example #3
0
 protected static function accepted_params()
 {
     return array('form' => array(Form::getInstance(), 'is_a', 'Form'), 'prop' => array(null, 'is_string'), 'name' => array('', 'is_string'), 'label' => array(str_replace('Element', '', get_class()), 'is_string'), 'title' => array('', 'is_string'), 'defVal' => array('', 'validate', true), 'defSortOrder' => array('ASC', array('ASC', 'DESC')), 'defSearchOp' => array('=', static::$search_options), 'allowEmpty' => array(true, 'is_bool'), 'isFilterable' => array(false, 'is_bool'), 'isEditable' => array(true, 'is_bool'), 'isListable' => array(true, 'is_bool'), 'isSelectable' => array(true, 'is_bool'), 'isOrderable' => array(false, 'is_bool'), 'isDefOrder' => array(false, 'is_bool'));
 }