本文整理汇总了PHP中kartik\date\DatePicker::init方法的典型用法代码示例。如果您正苦于以下问题:PHP DatePicker::init方法的具体用法?PHP DatePicker::init怎么用?PHP DatePicker::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\date\DatePicker
的用法示例。
在下文中一共展示了DatePicker::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* выполнит настройку параметров widget.
*
* @inheritdoc
*/
public function init()
{
parent::init();
$this->pluginOptions = isset($this->maskedInputOptions['pluginOptions']) ? $this->maskedInputOptions['pluginOptions'] : [];
$this->pluginEvents = isset($this->maskedInputOptions['pluginEvents']) ? $this->maskedInputOptions['pluginEvents'] : [];
if (isset($this->maskedInputOptions['mask'])) {
$this->pluginOptions['mask'] = $this->maskedInputOptions['mask'];
}
}
示例2: init
public function init()
{
// $id = $this->form_id ?: uniqid();
// $this->options['id'] = $id . '_timestamp';
if ($this->model) {
$value = $this->model->{$this->attribute};
if (is_numeric($value)) {
$this->options['value'] = Yii::$app->formatter->asDate($value);
}
}
if (!empty($this->value) && is_numeric($this->value)) {
$this->value = Yii::$app->formatter->asDate($this->value);
}
if (empty($this->options['placeholder'])) {
$this->options['placeholder'] = __('Select date');
}
$this->pluginOptions['autoclose'] = true;
$this->pluginOptions['format'] = strtolower(Yii::$app->formatter->dateFormat);
parent::init();
}
示例3: init
public function init()
{
if (empty($this->attribute2)) {
$this->attribute2 = $this->attribute . '_to';
}
if (empty($this->options)) {
$this->options = ['placeholder' => __('Start date')];
}
if (empty($this->options2)) {
$this->options2 = ['placeholder' => __('End date')];
}
$value = $this->model->{$this->attribute};
if (is_numeric($value)) {
$this->options['value'] = Yii::$app->formatter->asDate($value);
}
$value = $this->model->{$this->attribute2};
if (is_numeric($value)) {
$this->options2['value'] = Yii::$app->formatter->asDate($value);
}
$this->separator = sprintf('← %s →', __('between'));
$this->pluginOptions['format'] = strtolower(Yii::$app->formatter->dateFormat);
parent::init();
}