本文整理匯總了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();
}