I need to build the Gridview columns dynamically depending on what my customer is measuring. For example: One customer may have columns "quality", "speed", "satisfaction" and another customer may have "quality", "rank", "success"
As a result, I want to dynamically build my Gridview columns array as follows:
It only works if you use that code within the view. My understanding of Yii is that we should really avoid doing that and, instead, should pass things from the controller.
However, if you use the same code within the controller the function becomes "live" and tries to execute within the controller. If you wrap it in inverted commas then it is seen as text and the view tries to find a matching function within the model.