Cjuidatepicker is used for date input, which encapsulates the Jui DatePicker plug-in with the following basic usage:
<!--? php echo $form--->errorsummary ($model),?> <!--? php $this--->widget (' Zii.widgets.jui.CJuiDatePicker ', Array ( ' name ' = ' my_date ', ' language ' = ' en ', ' options ' = Array ( //' show ' (the default), ' Slidedown ', ' fadeIn ', ' fold ' showanim ' + ' fold ', ' showon ' = ' Button ',//' Focus ', ' button ', ' both ' buttontext ' = ' Select form calendar ', ' buttonimage ' = ' images/ Calendar.png ', ' buttonimageonly ' =>true, ' htmloptions ' =>array ( ' style ' = ' width ') : 80px;vertical-align:top ' ),) ; ? > Endwidget (?>);
To get the date entered, first assign a value to the Name property of Cjuidatepicker, this example is my_date, and then define Datamodel
Class Datamodel extends cformmodel{public $my _date;}
When the user submits, displays the date entered by the user, modifies the Sitecontroller's Actionindex
Public Function Actionindex () { $model =new datamodel (); if (!empty ($_post[' my_date ')) { $model->my_date=$_post[' my_date ']; if ($model->validate ()) { $this->render (' result ', array ( ' model ' = = $model, )); return; } } $this->render (' index ', array ( ' model ' = $model, ));}
The above is the content of the PHP Framework Yii Framework Tutorial (ZII) component-datepicker sample, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!