Yii
フレームワークのWidget
を普通に使う場合はこんな感じ。
1
2
3
4
5
6
7
8
9
10
11
12
| <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'birthday',
'language'=>'ja',
'options'=>array(
'dateFormat'=>'yy-mm-dd',
'firstDay' => 1,
'yearRange'=>'1900:+0',
'changeYear'=>'true',
'changeMonth'=>'true'
),
)); ?>
|
Smarty
テンプレートエンジンを使った場合はこんな感じ。
array
の書き方と、widget
の第3引数のtrue
がポイント。
1
2
3
4
5
6
7
8
9
10
11
12
| {$this->widget('zii.widgets.jui.CJuiDatePicker', [
'model'=>$model,
'attribute'=>'birthday',
'language'=>'ja',
'options'=>[
'dateFormat'=>'yy-mm-dd',
'firstDay' => 1,
'yearRange'=>'1900:+0',
'changeYear'=>'true',
'changeMonth'=>'true'
]
], true)}
|