示例#1
0
 function __construct($id, $css, $label, $type, $text = "")
 {
     parent::__construct($id, $css);
     $this->text = $text;
     $this->type = $type;
     $this->label = $label;
 }
示例#2
0
 /**
  * @param array $params
  */
 public function __construct(array $params)
 {
     $requiredParams = ['text' => '', 'type' => '', 'classes' => []];
     extract(array_merge($requiredParams, $params));
     parent::__construct($classes);
     $this->text = $text;
     $this->type = $type;
 }
示例#3
0
 /**
  * @param array $params
  */
 public function __construct(array $params)
 {
     $requiredParams = ['type' => 'text', 'label' => '', 'placeholder' => '', 'templateName' => '', 'required' => false, 'classes' => []];
     extract(array_merge($requiredParams, $params));
     parent::__construct($classes);
     $this->type = $type;
     $this->label = $label;
     $this->placeholder = $placeholder;
     $this->templateName = $templateName;
     $this->required = $required === 'true' ? 'required' : '';
 }
示例#4
0
 /**
  * @param array $params
  */
 public function __construct(array $params)
 {
     $requiredParams = ['type' => 'checkbox', 'label' => '', 'templateName' => '', 'required' => false, 'multiple' => false, 'classes' => []];
     extract(array_merge($requiredParams, $params));
     parent::__construct($classes);
     $this->type = $type;
     $this->label = $label;
     $this->values = $values;
     $this->required = $required === 'true' ? 'required' : '';
     $this->multiple = $multiple === 'true' ? 'multiple' : '';
     $this->templateName = $templateName;
 }
示例#5
0
 /**
  *
  * @param string $id
  * @param callback $onSubmit Called when the form is valid
  * @param callback $onError Called when the form is not valid
  */
 public function __construct($id, $onSubmit = null, $onError = null)
 {
     parent::__construct($id);
     if ($onSubmit != null) {
         Args::callBack($onSubmit, 'onSubmit');
     }
     if ($onError != null) {
         Args::callBack($onError, 'onError');
     }
     $this->onSubmit = $onSubmit;
     $this->onError = $onError;
 }
示例#6
0
 /**
  *
  * @param string $id
  * @param array $choices
  * @param Model $model 
  */
 public function __construct($id, $choices, ChoiceRenderer $choiceRenderer = null, Model $model = null, $isDisabled = null)
 {
     parent::__construct($id, $model);
     Args::isArray($choices, 'choices');
     $this->choices = $choices;
     if ($choiceRenderer == null) {
         $choiceRenderer = new ChoiceRenderer();
     }
     $this->choiceRenderer = $choiceRenderer;
     if ($isDisabled != null) {
         Args::callBackArgs($isDisabled, 2, 'isDisabled');
         $this->isDisabled = $isDisabled;
     }
 }
示例#7
0
 /**
  * @param array $params
  */
 public function __construct(array $params)
 {
     $requiredParams = ['type' => 'checkbox', 'label' => '', 'value' => '', 'templateName' => '', 'required' => false, 'classes' => []];
     extract(array_merge($requiredParams, $params));
     if (!is_array($classes)) {
         $classes = [];
     }
     //$classes[] = 'form-control';
     parent::__construct($classes);
     $this->type = $type;
     $this->label = $label;
     $this->value = $value;
     $this->required = $required === 'true' ? 'required' : '';
     $this->templateName = $templateName;
     $this->classes = implode(' ', $classes);
 }
示例#8
0
 function __construct($vo)
 {
     if (is_null($vo)) {
         throw new InvalidDataException();
     }
     parent::__construct();
     $this->api_method_to_call = NULL;
     if (is_array($vo)) {
         for ($a = 0; $a < sizeof($vo); $a++) {
             $fields = json_decode($vo[$a]->__toString());
             foreach ($fields as $k => $v) {
                 $caption = ucwords(str_replace("_", " ", $k));
                 parent::addField($k, $caption, "text", $v, $k);
             }
         }
     } else {
         $fields = json_decode($vo->__toString());
         foreach ($fields as $k => $v) {
             $caption = ucwords(str_replace("_", " ", $k));
             parent::addField($k, $caption, "text", $v, $k);
         }
     }
 }
示例#9
0
 public function __construct($id, FileModel $model = null)
 {
     parent::__construct($id, $model);
 }
示例#10
0
 function __construct($id, $css, $text)
 {
     parent::__construct($id, $css);
     $this->text = $text;
 }
示例#11
0
 function __construct($id, $css, $label, $items)
 {
     parent::__construct($id, $css);
     $this->items = $items;
     $this->label = $label;
 }