Trying to add a dynamic class value to one of my columns in CGridView:
'htmlOptions'=>array('class'=>'button-column $data->team'),
However the class just comes out as ‘$data->team’ anyway to achieve this? Some sort of eval call?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do this:
Edit:(Just a little more explanation)
According to the documentation for
cssClassExpressionthe following special variables are available:(Emphasis mine)I would go so far as to say that whenever any special variables are not mentioned in the documentation, we can assume that most probably, we can’t use them there (like in the case of
htmlOptions).