Ejemplo n.º 1
0
 /**
  * CheckBoxInput constructor
  *
  * @param string $name Název kontrolky
  * @param string $value Hodnota
  * @param AElement|string|null $label Popisek
  */
 public function __construct($name, $value, $label = null)
 {
     parent::__construct(self::TYPE, $name, $label);
     $this->setValue($value);
     $this->removeClass('form-group');
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * ANumericInputControl constructor
  *
  * @param string $type Typ kontrolky
  * @param string $name Název kontrolky
  * @param int|null $value Aktuální hodnota
  * @param int|null $min Minimální hodnota
  * @param int|null $max Maximální hodnota
  * @param int|null $step Krok, o kolik se bude hodnota měnit
  * @param LabelControl|string|null $label Popisek
  */
 public function __construct($type, $name, $value = null, $min = null, $max = null, $step = null, $label = null)
 {
     parent::__construct($type, $name, $label);
     if (!empty($value) && is_numeric($value)) {
         $this->setValue($value);
     }
     if (!empty($min) && is_numeric($min)) {
         $this->setMinValue($min);
     }
     if (!empty($max) && is_numeric($max)) {
         $this->setMaxValue($max);
     }
     if (!empty($step) && is_numeric($step)) {
         $this->setStep($step);
     }
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * ColorInput constructor
  *
  * @param string $name Název kontrolky
  * @param AElement|string|null $label Popisek
  */
 public function __construct($name, $label = null)
 {
     return parent::__construct(self::TYPE, $name, $label);
 }
Ejemplo n.º 4
0
 /**
  * UrlInput constructor
  *
  * @param string $name Název kontrolky
  * @param AElement|string|null $label Popisek
  */
 public function __construct($name, $label = null)
 {
     parent::__construct(self::TYPE, $name, $label);
     $this->addRule(new UrlRule());
     return $this;
 }
Ejemplo n.º 5
0
 /**
  * SubmitInput constructor
  *
  * @param string $name Název kontrolky
  * @param AElement|string|null $label Popisek
  */
 public function __construct($name, $label = null)
 {
     parent::__construct(self::TYPE, $name);
     $this->setValue($label);
 }