Hi there,
I’m building a view in order for people to see the items on my website, using a CGridView. I’ve been using the blog tutorial and it’s source code in order to make it. To code is nearly copy pasted.
However, this results in this error
public static function encode($text)
00065: {
00066: return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);
00067: }
The only thing that I’ve changed is the columns (in order to fit my DB) and I removed the buttons column. I’ve commented the only place where I use Chtml::Encode(), but the error persists. I tried with the buttons column too. Here’s the source involved into this.
Item-> getURL function
public function getUrl()
{
return Yii::app()->createUrl('consulter/view',array(
'ITE_Id'=>$this->ITE_Id,
'ITE_Name'=>$this->ITE_Name,
));
}
Controller action
public function actionConsulter()
{
$model=new Item('search');
if(isset($_GET['Item']))
$model->attributes=$_GET['Item'];
$this->render('consulter',array(
'model'=>$model,
));
}
the actual CGridView in my view
<?php $this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array(
'name'=>'ITE_Name',
'type'=>'raw',
'value'=>'CHtml::link(CHtml::encode($data->ITE_Name), $data->url)'
),
array(
'name'=>'ITE_Description',
'type'=>'raw',
'filter'=>false,
),
array(
'name'=>'Category_CAT_Id',
'value'=>'Category::model()->getAllCategories()',
'filter'=>false,
),
array(
'name'=>'ITE_Selling',
'type'=>'boolean',
'filter'=>false,
),
),
));
?>
I Hope you guys can see the light in this problem, because I can’t figure what it is. Thanks.