Nette\Forms\Controls\BaseControl::__construct PHP Method

__construct() public method

public __construct ( $caption = NULL )
    public function __construct($caption = NULL)
    {
        $this->monitor(Form::class);
        parent::__construct();
        $this->control = Html::el('input', ['type' => NULL, 'name' => NULL]);
        $this->label = Html::el('label');
        $this->caption = $caption;
        $this->rules = new Rules($this);
        if (self::$autoOptional) {
            $this->setRequired(FALSE);
        }
        $this->setValue(NULL);
    }

Usage Example

Exemplo n.º 1
0
 public function __construct($label = NULL, array $items = NULL)
 {
     parent::__construct($label);
     if ($items !== NULL) {
         $this->setItems($items);
     }
 }
All Usage Examples Of Nette\Forms\Controls\BaseControl::__construct