Ejemplo n.º 1
0
 /**
  * @param string $name The name of this form element
  * @param array  $options The available options
  * @param string $label The label text for this element (will be autoescaped)
  */
 public function __construct($name, $options, $label = '')
 {
     parent::__construct('dropdown', $name, $label);
     $this->rmattr('type');
     $this->optGroups[''] = new OptGroup(null, $options);
     $this->val('');
 }
Ejemplo n.º 2
0
 /**
  * @param string $name The name of this form element
  * @param string $label The label text for this element
  */
 public function __construct($name, $label)
 {
     parent::__construct('textarea', $name, $label);
     $this->attr('dir', 'auto');
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
 }
Ejemplo n.º 4
0
 /**
  * @param string $name The name of this form element
  * @param string $options The available options
  * @param string $label The label text for this element (will be autoescaped)
  */
 public function __construct($name, $options, $label = '')
 {
     parent::__construct('dropdown', $name, $label);
     $this->options($options);
 }
Ejemplo n.º 5
0
 /**
  * @param string $id
  * @param array  $htmlAttributes
  */
 public function __construct($id, array $htmlAttributes = [])
 {
     parent::__construct('text', $id, $htmlAttributes);
 }
Ejemplo n.º 6
0
 /**
  * @param string $id
  * @param string $group
  * @param array  $value
  * @param array  $htmlAttributes
  */
 public function __construct($id, $group, $value, array $htmlAttributes)
 {
     parent::__construct('checkbox', $id, $htmlAttributes);
     $this->addAttributes(['name' => $group . '[' . $value . ']']);
     parent::setValue($value);
 }
Ejemplo n.º 7
0
 /**
  * InputCheckboxElement constructor.
  * @param $name
  * @param null $value
  * @param array $attributes
  */
 public function __construct($name, $value = null, array $attributes = [])
 {
     parent::__construct($name, $value, $attributes);
     $this->setAttribute('type', 'checkbox');
 }
Ejemplo n.º 8
0
 /**
  * @param string $type The type of this element
  * @param string $name The name of this form element
  * @param string $label The label text for this element
  */
 public function __construct($type, $name, $label)
 {
     parent::__construct($type, $name, $label);
     // default value is 1
     $this->attr('value', 1);
 }
Ejemplo n.º 9
0
 /**
  * InputRangeElement constructor.
  * @param $name
  * @param int $min
  * @param int $max
  * @param int $step
  * @param null $value
  * @param array $attributes
  */
 public function __construct($name, $min = 0, $max = 0, $step = 1, $value = null, array $attributes = [])
 {
     parent::__construct($name, $value, $attributes);
     $this->setAttributes(['type' => 'range', 'min' => (int) $min, 'max' => (int) $max, 'step' => (int) $step]);
 }
Ejemplo n.º 10
0
 /**
  * InputButtonElement constructor.
  * @param null $value
  * @param array $attributes
  */
 public function __construct($value = null, array $attributes = [])
 {
     parent::__construct(null, $value, $attributes);
     $this->setAttribute('type', 'button');
 }
Ejemplo n.º 11
0
 /**
  * @param string $id
  * @param array  $htmlAttributes
  */
 public function __construct($id, array $htmlAttributes)
 {
     parent::__construct('password', $id, $htmlAttributes);
 }
Ejemplo n.º 12
0
 /**
  * @param string $id
  * @param array  $htmlAttributes
  */
 public function __construct($id, array $htmlAttributes)
 {
     parent::__construct('hidden', $id, $htmlAttributes);
 }
Ejemplo n.º 13
0
 /**
  * @param string $id
  * @param string $group
  * @param array  $value
  * @param array  $htmlAttributes
  */
 public function __construct($id, $group, $value, array $htmlAttributes)
 {
     parent::__construct('radio', $id, $htmlAttributes);
     $this->addAttributes(['name' => $group]);
     parent::setValue($value);
 }
Ejemplo n.º 14
0
 /**
  * @param string $id
  * @param string $title
  * @param array  $htmlAttributes
  */
 public function __construct($id, $title, array $htmlAttributes = [])
 {
     parent::__construct('submit', $id, $htmlAttributes);
     $this->setValue($title);
 }