当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseControl::__construct方法代码示例

本文整理汇总了PHP中Nette\Forms\Controls\BaseControl::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseControl::__construct方法的具体用法?PHP BaseControl::__construct怎么用?PHP BaseControl::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nette\Forms\Controls\BaseControl的用法示例。


在下文中一共展示了BaseControl::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($label = NULL, array $items = NULL)
 {
     parent::__construct($label);
     if ($items !== NULL) {
         $this->setItems($items);
     }
 }
开发者ID:jjanekk,项目名称:forms,代码行数:7,代码来源:MultiChoiceControl.php

示例2: __construct

 /**
  * @return ShiftPatternDate
  */
 public function __construct(Template $template, DateTime $date, $templateFileName)
 {
     parent::__construct(null);
     $this->addRule(__CLASS__ . '::validatePattern', 'Shift pattern is invalid.');
     $this->_template = $template;
     $this->_template->setFile(__DIR__ . "/{$templateFileName}");
     $this->_template->registerHelper('dayName', function ($dayNumber) {
         return DateTime::dayName($dayNumber);
     });
     $this->_template->registerHelper('padTime', function ($t) {
         if ($t < 10) {
             return '0' . $t;
         }
         return $t;
     });
     $this->_template->registerHelper('selectOption', function ($timeUnit, $time, $type) {
         $timeUnit = (int) $timeUnit;
         list($hour, $minute) = explode(':', $time);
         $hour = (int) $hour;
         $minute = (int) $minute;
         if ($type === 'h') {
             return $timeUnit === $hour ? 'selected="selected"' : '';
         }
         if ($type === 'm') {
             return $timeUnit === $minute ? 'selected="selected"' : '';
         }
     });
     // returns curren formated date and moves date one day forward
     $this->_template->registerHelper('day', function ($date) {
         $day = $date->format('j F');
         $date->addDay();
         return $day;
     });
     $this->_date = $date;
 }
开发者ID:dansilovsky,项目名称:calendar,代码行数:38,代码来源:PatternInput.php

示例3: __construct

 /**
  * Class constructor.
  *
  * @param    string            date format
  * @param    string            label
  */
 public function __construct($format = self::W3C_DATE_FORMAT, $language = self::DEFAULT_LANGUAGE, $label = NULL)
 {
     parent::__construct($label);
     $this->control->type = 'text';
     $this->format = $format;
     $this->language = $language;
 }
开发者ID:remism,项目名称:bootstrap-nette-datepicker,代码行数:13,代码来源:BootstrapDatePicker.php

示例4: __construct

 /**
  * Constructor
  *
  * @param string $label
  * @param string|Template $content
  */
 public function __construct($label, $content)
 {
     parent::__construct($label);
     $this->setDisabled(TRUE);
     $this->setOmitted(TRUE);
     $this->setContent($content);
 }
开发者ID:f3l1x,项目名称:nette-plugins,代码行数:13,代码来源:MarkupControl.php

示例5: __construct

 public function __construct($label = null, array $entity = NULL, array $config = NULL)
 {
     parent::__construct($label);
     $this->entity = $entity;
     $this->labelName = $label;
     $this->options = $config;
 }
开发者ID:nechutny,项目名称:form-selectize,代码行数:7,代码来源:Selectize.php

示例6: __construct

 /**
  * @param  string  label
  * @param  bool  allows to upload multiple files
  */
 public function __construct($label = NULL, $multiple = FALSE)
 {
     parent::__construct($label);
     $this->control->type = 'file';
     $this->control->multiple = (bool) $multiple;
     $this->setOption('type', 'file');
 }
开发者ID:MartinSadovy,项目名称:forms,代码行数:11,代码来源:UploadControl.php

示例7: __construct

 public function __construct($caption, $publicKey, $privateKey)
 {
     $this->monitor('Nette\\Forms\\Form');
     parent::__construct($caption);
     $this->publicKey = $publicKey;
     $this->privateKey = $privateKey;
 }
开发者ID:bazo,项目名称:translation-ui,代码行数:7,代码来源:ReCaptcha.php

示例8: __construct

 /**
  * @param null $label
  * @param $config
  * @param null $display
  * @param null $remote
  */
 public function __construct($label, $config, $display = NULL, $remote = NULL)
 {
     parent::__construct($label);
     $this->monitor('Nette\\Application\\UI\\Presenter');
     $this->remote = $remote;
     $this->display = $display;
 }
开发者ID:vojtys,项目名称:typeahead,代码行数:13,代码来源:TypeaheadInput.php

示例9: __construct

 /**
  * @param  string  label
  */
 public function __construct($label = NULL)
 {
     parent::__construct($label);
     $this->control->type = 'checkbox';
     $this->wrapper = Nette\Utils\Html::el();
     $this->setOption('type', 'checkbox');
 }
开发者ID:nette,项目名称:forms,代码行数:10,代码来源:Checkbox.php

示例10: __construct

 /**
  * @param string $siteKey
  * @param string $label
  */
 public function __construct($siteKey, $label = NULL)
 {
     parent::__construct($label);
     $this->siteKey = $siteKey;
     $this->control = Html::el('div');
     $this->control->addClass('g-recaptcha');
 }
开发者ID:minetro,项目名称:recaptcha,代码行数:11,代码来源:ReCaptchaField.php

示例11: __construct

 /**
  * @param string $label
  * @param CaptchaProvider $provider
  */
 public function __construct($label, CaptchaProvider $provider)
 {
     parent::__construct($label);
     $this->provider = $provider;
     $this->control = Html::el('img');
     $this->control->addClass('captcha-image seznam-captcha-image');
 }
开发者ID:minetro,项目名称:seznamcaptcha,代码行数:11,代码来源:CaptchaImage.php

示例12: __construct

 /**
  * @param  string  label
  * @param  array   items from which to choose
  * @param  int     number of rows that should be visible
  */
 public function __construct($type, $label = NULL, $size = NULL)
 {
     parent::__construct($label);
     $this->control->setName('select');
     $this->control->size = $size > 1 ? (int) $size : NULL;
     $this->type = $type;
 }
开发者ID:svobodni,项目名称:web,代码行数:12,代码来源:ManyToOne.php

示例13: __construct

 public function __construct($caption = NULL, $side, $border)
 {
     $this->monitor('Nette\\Forms\\Form');
     parent::__construct($caption);
     $this->side = $side;
     $this->border = $border;
 }
开发者ID:bazo,项目名称:nette-form-controls,代码行数:7,代码来源:ColorPicker.php

示例14: __construct

 public function __construct($caption = NULL, $min, $max)
 {
     $this->monitor('Nette\\Forms\\Form');
     parent::__construct($caption);
     $this->min = $min;
     $this->max = $max;
 }
开发者ID:bazo,项目名称:nette-form-controls,代码行数:7,代码来源:PlusMinus.php

示例15: __construct

 public function __construct($forcedValue = NULL)
 {
     parent::__construct();
     $this->control->type = 'hidden';
     $this->value = (string) $forcedValue;
     $this->forcedValue = $forcedValue;
 }
开发者ID:genextwebs,项目名称:dropbox-sample,代码行数:7,代码来源:HiddenField.php


注:本文中的Nette\Forms\Controls\BaseControl::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。