使用时出现以下错误yiicgridview
Parse error: syntax error, unexpected T_FUNCTION in /home/.../result.php on line 23
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'product-table',
'dataProvider'=>$model->search(),
'columns'=>array(
array('header' => '#','value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)','headerHtmlOptions'=>array('class'=>'table-header-check')),
array('name'=>'testname'),
array('header'=> 'Subject Name','value'=>'$data->sub->subname'),
array('header'=>'Validity', 'value'=>'$data->testfrom." To ".$data->testto'),
array('header'=>'attemptedstudents',
'value'=>function($data){
$dataReader = Yii::app()->db->createCommand('SELECT COUNT(stdid)as atstd FROM studenttest WHERE testid='.$data->testid.' AND status ="over"')->query();
$atStd = $dataReader->read();
return $atStd['atstd']; }),
array('header'=>'Details',
'class'=>'CButtonColumn',
'template'=>'{details}',
'buttons' => array (
'details' =>array('imageUrl'=>Yii::app()->request->baseUrl.'/css/images/detail.png',
'url'=>'Yii::app()->createUrl("test/resultdetail", array("testid"=>$data->testid))',
'options'=>array( 'class'=>'icon-manage')),
),
),
),
'itemsCssClass' => 'table table-striped table-bordered bootstrap-datatable datatable',
'cssFile'=>false,
));?>
错误行代码是 'array('header'=>'attemptedstudents','value'=>function($data){';
但此代码在 XAMP 本地主机中运行良好。但它上传到服务器我收到此错误。任何人请指导我..