Пример #1
0
 /**
  * @param callable|string $name of input
  */
 public function __construct($name)
 {
     parent::__construct();
     $this->withHtmlElementName('textarea');
     $this->withName($name);
     $this->withDefaultContent(function (TextareaElement $input) {
         return $input->getValue();
     });
 }
Пример #2
0
 /**
  * @param string|Htmlable|array|Arrayable $tag_contents
  * @param string $button_type
  */
 public function __construct($tag_contents, $button_type = "submit")
 {
     parent::__construct();
     $this->withHtmlElementName('button');
     $this->withContent($tag_contents);
     $this->withAttribute('type', $button_type);
     $this->withAttribute('value', function (AbstractFormControl $input) {
         return $input->getValue();
     });
 }
Пример #3
0
 /**
  * @param callable|string $name of input
  * @param string $input_type of input, defaults to text
  */
 public function __construct($name, $input_type = 'text')
 {
     parent::__construct();
     $this->withHtmlElementName('input');
     $this->withName($name);
     $this->withAttribute('type', $input_type);
     $this->withAttribute('value', function (AbstractFormControl $input) {
         return $input->getValue();
     });
 }
Пример #4
0
 public function __construct($name, $options = null)
 {
     parent::__construct();
     $this->options = new Collection();
     $this->selected_options = new Collection();
     $this->disabled_options = new MapCollection();
     $this->withHtmlElementName('select');
     $this->withName($name);
     $this->withOptions($options);
     $this->withContent(function () {
         return $this->getOptionElements();
     });
 }