[英]how to get DB sqlite data from strings.xml so when i change the locale all the data can be translated
[英]when I update data,how to get data from db with CJuiDatePicker?
当我在yii中使用CJuiDatePicker时,我想在opdate页面中获取数据。但是CJuiDatePicker无法从数据库获取数据。以下是代码,
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'name'=>'B2bTicket[examdate]',
'attribute' => 'B2bTicket[examdate]',
// additional javascript options for the date picker plugin
'options'=>array(
'altField' => 'examdate',
'dateFormat' => 'yy-mm-dd',
'showAnim'=>'slide',//'slide','fold','slideDown','fadeIn','blind','bounce','clip','drop'
'autocomplete' => 'true'
),
'htmlOptions'=>array(
'style'=>'height:20px;background-color:white;color:#000;',
),
));
?>
谁能帮我解决问题? 我的问题是,当我进入更新页面时,无法从db自动获取数据。
增值选项。
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'name'=>'B2bTicket[examdate]',
'attribute' => 'B2bTicket[examdate]',
'value' => $model->isNewRecord?date("Y-m-d"):$model->examdate,//here is the line!
// additional javascript options for the date picker plugin
'options'=>array(
'altField' => 'examdate',
'dateFormat' => 'yy-mm-dd',
'showAnim'=>'slide',//'slide','fold','slideDown','fadeIn','blind','bounce','clip','drop'
'autocomplete' => 'true'
),
'htmlOptions'=>array(
'style'=>'height:20px;background-color:white;color:#000;',
),
));
?>
这将在创建页面上显示当前日期,并在更新时显示属性值日期。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.