Esempio n. 1
0
 /**
  * @param string $name
  * @param string $label
  * @param array $values
  */
 public function __construct(string $name, string $label = null, array $values = [])
 {
     parent::__construct('<input />', $name, $label);
     $this->getField()->addAttribute('type', 'hidden');
     $this->getField()->setRenderable(false);
     $this->addClass('form-group cawa-fields-button-group');
     $this->values = $values;
 }
Esempio n. 2
0
 /**
  * @param string $name
  * @param string $label
  * @param array $options
  */
 public function __construct(string $name, string $label = null, array $options = [])
 {
     parent::__construct('<select>', $name, $label);
     $isAssociative = array_keys($options) !== range(0, count($options) - 1);
     $this->addOption('', '&nbsp;');
     foreach ($options as $key => $value) {
         $this->addOption($isAssociative ? (string) $key : (string) $value, $value);
     }
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function __construct(string $name = null, string $label = null)
 {
     if (is_null($label)) {
         self::translator()->addFile(__DIR__ . '/../../../lang/global', 'bootstrap');
         $label = self::trans('bootstrap.creditcard/expiration');
     }
     parent::__construct('<input />', $name, $label);
     $this->getField()->addAttribute('type', 'text');
     $this->getField()->addClass('form-control');
     $this->addClass('form-group');
     $this->setPlaceholder(self::trans('bootstrap.creditcard/expirationPlaceholder'));
     $this->getField()->addClass('cawa-fields-creditcard-expiry cc-exp');
     $this->getField()->addAttribute('autocomplete', 'cc-exp');
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function __construct(string $name = null, string $label = null)
 {
     if (is_null($label)) {
         self::translator()->addFile(__DIR__ . '/../../../lang/global', 'bootstrap');
         $label = self::trans('bootstrap.creditcard/cvv');
     }
     parent::__construct('<input />', $name, $label);
     $this->getField()->addAttribute('type', 'text');
     $this->getField()->addClass('form-control');
     $this->addClass('form-group');
     $this->getField()->addClass('cawa-fields-creditcard-cvc cc-cvc');
     $this->getField()->addAttribute('autocomplete', 'off');
     $this->getField()->addAttribute('size', '4');
 }
Esempio n. 5
0
 /**
  * @param string $name
  * @param string $label
  */
 public function __construct(string $name, string $label = null)
 {
     parent::__construct('<input />', $name, $label);
     $this->getField()->addAttribute('type', 'datetime-local');
 }