PHP YII Change the Row Color Based on the Column value in CGridView [rowCssClassExpression]

Belows is how you can use CGridView ‘rowCssClassExpression’ to change row color based on a column’s value:
$this->widget('zii.widgets.grid.CGridView', array(
You can also call a custom php function, and pass the $data variable to it. That function should return the class name for the given row 🙂

Leave a comment

Your email address will not be published. Required fields are marked *