__construct() public method

public __construct ( $label = NULL, $maxLength = NULL )
Ejemplo n.º 1
0
 /**
  * @param string $label
  * @return Forms\Controls\DatePicker
  */
 public function __construct($label = NULL)
 {
     parent::__construct($label);
     $this->addCondition(Form::FILLED)->addRule(function ($control) {
         return $control->getValue() instanceof DateTime;
     }, 'brosland.forms.datePicker.invalidDate');
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @param string
  * @param array
  */
 public function __construct($label = NULL, array $items = NULL)
 {
     parent::__construct($label);
     if ($items !== NULL) {
         $this->setItems($items);
     }
 }
 /**
  * @param RepositoryContainer $orm
  * @param NULL|bool $editable
  */
 public function __construct(RepositoryContainer $orm, $editable = FALSE)
 {
     $this->orm = $orm;
     parent::__construct(NULL);
     $this->setTranslator(NULL);
     $this->editable = $editable;
 }
Ejemplo n.º 4
0
 /**
  * @param string|Html $label
  * @param int null $cols
  * @param int null $maxLength
  * @param string $msg
  */
 public function __construct($label = '', $cols = NULL, $maxLength = NULL, $msg = '')
 {
     parent::__construct($label, $cols, $maxLength);
     $this->setDefaultValue('Toto pole vymažte (antispam)');
     $this->setAttribute('class', 'form-control input-lg');
     $this->addRule(Form::BLANK, $msg);
 }
Ejemplo n.º 5
0
 /**
  * @param string|null $label
  */
 public function __construct($label = NULL)
 {
     parent::__construct($label);
     $this->filtersOut[] = $this->sanitize;
     $this->filtersOut[] = $this->unformat;
     $this->filtersIn[] = $this->format;
     $this->value = NULL;
 }
Ejemplo n.º 6
0
 function __construct($label = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $maxLength);
     $this->setType('password');
     $this->control->addClass('form-control');
     $this->setOption('noFormControl', TRUE);
     $addMethod = (new \ReflectionClass(Html::class))->hasMethod('addHtml') ? 'addHtml' : 'add';
     $this->fullControl = Html::el('span')->addClass('input-group')->{$addMethod}('<span class="input-group-btn"><span class="btn btn-default"><i class="glyphicon glyphicon-eye-open"></i></span></span>')->addAttributes(['data-instante-displayable-password' => TRUE]);
 }
Ejemplo n.º 7
0
 /**
  * @param string $label
  * @param string $dateFormat
  */
 public function __construct($label, $dateFormat)
 {
     parent::__construct($label);
     $this->dateFormat = $dateFormat;
     $this->controlPrototype->{'data-date-format'} = DateMacro::phpToJsDateFormat($dateFormat);
     $this->addRule(function () {
         return empty($this->rawValue) || $this->getValue() instanceof \DateTime;
     }, 'Please enter the date in the correct format. Eg . 02/22/2020 02:22 PM');
 }
Ejemplo n.º 8
0
 public function __construct($label = NULL, $type)
 {
     if (!isset($this->aFormats[$type])) {
         throw new \InvalidArgumentException("addDate: invalid date type '{$type}' given.");
     }
     parent::__construct($label);
     $this->type = $type;
     $this->control->addClass('nette-date-time');
     $this->control->data('dateinput-type', $type);
 }
Ejemplo n.º 9
0
 public function __construct($caption = NULL, $callback = NULL)
 {
     parent::__construct($caption);
     $this->setCallback($callback);
 }
Ejemplo n.º 10
0
 /**
  * @param callback $callback
  * @param string   $label
  * @param int      $maxLength
  */
 public function __construct($callback = NULL, $label = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $maxLength);
     $this->callback = $callback;
     $this->monitor('Nette\\Application\\IPresenter');
 }
Ejemplo n.º 11
0
 /**
  * Initialization
  *
  * @param string $label label
  * @param int $maxLength maximum count of chars
  */
 public function __construct($label = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $maxLength);
 }
Ejemplo n.º 12
0
 public function __construct($caption = null, $callback = null)
 {
     parent::__construct($caption);
     $this->setCallback($callback);
 }
Ejemplo n.º 13
0
 /**
  * Construct a textinput and set suggestLink and suggester
  * 
  * @param string|NULL $label            The textual label of the control
  * @param string|NULL $suggestLink      Link to the page that returns 
  *                                      suggested items
  * @param ISuggester|NULL $suggester    The suggester of items
  * @param int|NULL $cols                If not null, declares the width of
  *                                      the input in number of chars that
  *                                      fit into
  * @param int|NULL $maxLength           If not null, declares the maximal
  *                                      length of the typed text
  * @return void
  */
 public function __construct($label = NULL, $suggestLink = NULL, SuggestInput\ISuggester $suggester = NULL, $cols = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $cols, $maxLength);
     $this->suggestLink = $suggestLink;
     $this->suggester = $suggester;
 }
Ejemplo n.º 14
0
 /**
  * @param string $label label
  * @param string $format
  */
 public function __construct($label = null, $format = 'd.m.Y H:i')
 {
     parent::__construct($label, null);
     $this->container = Html::el("div");
     $this->format = $format;
 }
Ejemplo n.º 15
0
 public function __construct($label = null, $cols = null, $maxLength = null)
 {
     $this->container = Html::el();
     $this->prompt = true;
     parent::__construct($label, $cols, $maxLength);
 }
Ejemplo n.º 16
0
 /**
  * @param string|NULL $caption
  * @param IDateTimeConverter $dateConverter
  */
 public function __construct($caption, IDateTimeConverter $dateConverter)
 {
     parent::__construct($caption);
     $this->dateConverter = $dateConverter;
 }
Ejemplo n.º 17
0
 /**
  * @param string $label
  * @param int $maxLength
  */
 public function __construct($label, $maxLength = 5)
 {
     parent::__construct($label, $maxLength);
     $this->control->addClass('captcha-input seznam-captcha-input');
 }
Ejemplo n.º 18
0
 /**
  * @param string $caption
  * @param string $format
  * @throws \Exception
  */
 public function __construct($caption = NULL, $format = NULL)
 {
     parent::__construct($caption);
     $this->setFormat($format ?: self::$dateFormat);
 }
Ejemplo n.º 19
0
 /**
  * @param PhoneUtils $phoneUtils
  * @param string|NULL $label
  * @param int|NULL $maxLength
  */
 public function __construct(PhoneUtils $phoneUtils, $label = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $maxLength);
     $this->phoneUtils = $phoneUtils;
 }
Ejemplo n.º 20
0
 public function __construct($label = NULL, $formatUI = 'd.m.yy', $format = 'j.n.Y')
 {
     parent::__construct($label);
     $this->format = $format;
     $this->formatUi = $formatUI;
 }
Ejemplo n.º 21
0
 /**
  * @param string $label
  * @param int $maxLength maximum number of characters the user may enter
  */
 public function __construct($label = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $maxLength);
     $this->setType('password');
     $this->container = Html::el();
 }
Ejemplo n.º 22
0
 /**
  * @param  string  label
  * @param  int  maximum number of characters the user may enter
  */
 public function __construct($label = null)
 {
     parent::__construct($label, 10);
     //$this->control->type = 'date';
 }
Ejemplo n.º 23
0
 /**
  * @inheritdoc
  */
 public function __construct(DataSourceDescriptor $dataSourceDescriptor, $label = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $maxLength);
     $this->dataSourceDescriptor = $dataSourceDescriptor;
 }
Ejemplo n.º 24
0
 /**
  * @param string|Html
  * @param int
  * @param int
  * @param string
  */
 public function __construct($label = '', $cols = NULL, $maxLength = NULL, $msg = '')
 {
     parent::__construct($label, $cols, $maxLength);
     $this->setDefaultValue('http://');
     $this->addRule(Form::BLANK, $msg);
 }
Ejemplo n.º 25
0
 public function __construct($label = NULL, $multiple = false, $imageOnly = true)
 {
     parent::__construct($label);
     $this->imageOnly = $imageOnly;
     $this->multiple = $multiple;
 }