【发布时间】:2012-06-05 01:34:05
【问题描述】:
在我的 Vacation 模型中 Vac 我有这个功能
public function getVacCount(){
这个函数返回一个假期有多少天。
我想像这样向 cgridview 添加一个自定义列:
<?php
$this->widget('zii.widgets.grid.CGridView', array(
...
array(
'name' => 'count',
'value' => '$data->getVacPeriod()'
),
...
),
));
?>
它工作正常。 但我不知道如何对这个自定义属性进行排序。 我尝试使用 CSort 但它不起作用。有什么想法吗?
【问题讨论】:
标签: sorting yii virtual-attribute