Beispiel #1
0
 public function build()
 {
     $output = "";
     unset($this->attributes['type'], $this->attributes['size']);
     if (parent::build() === false) {
         return;
     }
     switch ($this->status) {
         case "disabled":
         case "show":
             if (!isset($this->value)) {
                 $output = $this->layout['null_label'];
             } else {
                 $output = $this->description;
             }
             $output = "<div class='help-block'>" . $output . "&nbsp;</div>";
             break;
         case "create":
         case "modify":
             $output = Form::select($this->name, $this->options, $this->value, $this->attributes) . $this->extra_output;
             break;
         case "hidden":
             $output = Form::hidden($this->name, $this->value);
             break;
         default:
     }
     $this->output = $output;
 }
Beispiel #2
0
 public function options($name, $options = [])
 {
     $options = empty($options) ? [1 => 'Active', '' => 'Disable'] : $options;
     return Form::select($name, $options, $this->{$name}, ['class' => 'form-control']);
 }