本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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');
}
示例7: __construct
public function __construct($caption, $publicKey, $privateKey)
{
$this->monitor('Nette\\Forms\\Form');
parent::__construct($caption);
$this->publicKey = $publicKey;
$this->privateKey = $privateKey;
}
示例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;
}
示例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');
}
示例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');
}
示例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');
}
示例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;
}
示例13: __construct
public function __construct($caption = NULL, $side, $border)
{
$this->monitor('Nette\\Forms\\Form');
parent::__construct($caption);
$this->side = $side;
$this->border = $border;
}
示例14: __construct
public function __construct($caption = NULL, $min, $max)
{
$this->monitor('Nette\\Forms\\Form');
parent::__construct($caption);
$this->min = $min;
$this->max = $max;
}
示例15: __construct
public function __construct($forcedValue = NULL)
{
parent::__construct();
$this->control->type = 'hidden';
$this->value = (string) $forcedValue;
$this->forcedValue = $forcedValue;
}