Hello all,
Is it possible to manipulate the data that’s stored in a dataProvider? I am using the CGridView to display the info. Before displaying the data from the dataProvider in that grid, I need the data to run through PHP’s strip_tags(), to remove any HTML tags:
-
Retrieve data via CActiveDataProvider
-
Manipulate data by running strip_tags() on the columns
-
Output the data using the CGridView widget
I realize I could just output the data manually and not use a dataProvider and grid view, but I really don’t want to complicate things, so I’m wondering if there is a way to somehow manipulate my dataProvider’s data, or tell the CGridView to manipulate the data before outputting it.
Here’s the relevant code:
The controller:
$dataProvider=new CActiveDataProvider('Data', array(
'criteria'=>array(
'condition'=>'active=1',
The view:
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProvider,
'columns'=>array(
'column1',
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
),
),
));
Thanks a lot for any help