__construct() public method

public __construct ( $label = NULL, $maxLength = NULL )
コード例 #1
0
ファイル: DatePicker.php プロジェクト: brosland/framework
 /**
  * @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');
 }
コード例 #2
0
 /**
  * Constructor
  *
  * @param string
  * @param array
  */
 public function __construct($label = NULL, array $items = NULL)
 {
     parent::__construct($label);
     if ($items !== NULL) {
         $this->setItems($items);
     }
 }
コード例 #3
0
 /**
  * @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;
 }
コード例 #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);
 }
コード例 #5
0
ファイル: MoneyControl.php プロジェクト: f3l1x/nette-plugins
 /**
  * @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;
 }
コード例 #6
0
ファイル: DisplayablePassword.php プロジェクト: instante/ui
 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]);
 }
コード例 #7
0
ファイル: DateTimeControl.php プロジェクト: mike227/n-forms
 /**
  * @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');
 }
コード例 #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);
 }
コード例 #9
0
 public function __construct($caption = NULL, $callback = NULL)
 {
     parent::__construct($caption);
     $this->setCallback($callback);
 }
コード例 #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');
 }
コード例 #11
0
ファイル: TbDatePicker.php プロジェクト: bombush/NatsuCon
 /**
  * Initialization
  *
  * @param string $label label
  * @param int $maxLength maximum count of chars
  */
 public function __construct($label = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $maxLength);
 }
コード例 #12
0
ファイル: Typeahead.php プロジェクト: nextras/forms
 public function __construct($caption = null, $callback = null)
 {
     parent::__construct($caption);
     $this->setCallback($callback);
 }
コード例 #13
0
ファイル: SuggestInput.php プロジェクト: soundake/pd
 /**
  * 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;
 }
コード例 #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;
 }
コード例 #15
0
ファイル: TextWithSelect.php プロジェクト: venne/venne
 public function __construct($label = null, $cols = null, $maxLength = null)
 {
     $this->container = Html::el();
     $this->prompt = true;
     parent::__construct($label, $cols, $maxLength);
 }
コード例 #16
0
 /**
  * @param string|NULL $caption
  * @param IDateTimeConverter $dateConverter
  */
 public function __construct($caption, IDateTimeConverter $dateConverter)
 {
     parent::__construct($caption);
     $this->dateConverter = $dateConverter;
 }
コード例 #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');
 }
コード例 #18
0
ファイル: Date.php プロジェクト: webchemistry/forms-controls
 /**
  * @param string $caption
  * @param string $format
  * @throws \Exception
  */
 public function __construct($caption = NULL, $format = NULL)
 {
     parent::__construct($caption);
     $this->setFormat($format ?: self::$dateFormat);
 }
コード例 #19
0
ファイル: Phone.php プロジェクト: iPublikuj/form-phone
 /**
  * @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;
 }
コード例 #20
0
ファイル: Date.php プロジェクト: vsek/formExtension
 public function __construct($label = NULL, $formatUI = 'd.m.yy', $format = 'j.n.Y')
 {
     parent::__construct($label);
     $this->format = $format;
     $this->formatUi = $formatUI;
 }
コード例 #21
0
ファイル: PswdInput.php プロジェクト: lohini/framework
 /**
  * @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();
 }
コード例 #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';
 }
コード例 #23
0
ファイル: TagInput.php プロジェクト: achse/nette-tag-input
 /**
  * @inheritdoc
  */
 public function __construct(DataSourceDescriptor $dataSourceDescriptor, $label = NULL, $maxLength = NULL)
 {
     parent::__construct($label, $maxLength);
     $this->dataSourceDescriptor = $dataSourceDescriptor;
 }
コード例 #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);
 }
コード例 #25
0
ファイル: FileUpload.php プロジェクト: vsek/formExtension
 public function __construct($label = NULL, $multiple = false, $imageOnly = true)
 {
     parent::__construct($label);
     $this->imageOnly = $imageOnly;
     $this->multiple = $multiple;
 }