我试着改变我的GridView列宽.这是我的代码:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id' => 'prefixs-grid',
'dataProvider' => $model->search(),
'filter' => $model,
'columns' => array(
array(
'name' => 'id',
'header' => 'No.',
'htmlOptions' => array('class' => 'center'),
),
array(
'name' => 'pfx',
'htmlOptions' => array('width' => 30),
),
array(
'class' => 'CButtonColumn',
),
),
)); ?>
Run Code Online (Sandbox Code Playgroud)
当我运行'pfx'列时,宽度必须更改为30,但宽度相同.我怎么能改变列的宽度?有任何想法吗?
我正在尝试创建这样的网址:www.domain.com/auth?join=social在 yii. 这是我的配置:
'urlManager' => array(
'urlFormat' => 'path',
'rules' => array(
'<action:(auth)>' => 'site/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
'showScriptName'=>false,
),
Run Code Online (Sandbox Code Playgroud)
当我调用此:www.domain.com/auth?join=social页面时,我无法获取参数:join。但当我打电话时www.domain.com/index.php/auth?join=social我可以接听。我用这段代码获取参数:$social = Yii::app()->request->getParam('join');。我的错误在哪里?
我需要将 1960 年代初期的日期插入到timestampmysql的 字段中。我在时间戳中有一个字段“sent_date”。我正在尝试插入 '1960-05-18 03:20:00' (在 unix 时间戳 -303684000 中)但 mysql 给了我错误。我如何插入 60 年代的日期?我的查询:INSERT INTO support (sent_date) VALUES(-303684000)