obtain $data from $DataProvider

Hello People, I need your help.

I have the following code:


        $this->widget('booster.widgets.TbGridView', array(

            'id' => 'sucursal-grid',

            'dataProvider' => $DataProviderSemanas,            

            'columns' => array(                                                                                                  


                    'name' => 'lun',


                    'value'=>'$data->lun == 1 ? "Si" : " "',


Well, When I want to obtain the $data->lun I have an Error. How can I obtain this data from $DataProviederSemanas?

Where $DataProviederSeamanas is:










Thanks Very much for your help!!


from your example [color=#1C2837][size=2] $DataProviederSeamanas is an array so you need to use $data[‘lun’][/size][/color]

Thanks for your help. But can’t.

I do:

'value'=>$data['lun'] . " == 1 ? 'Si' : ' ' "

what is the error?

Thanks very much!!

you need an expression as a string… .try with

'value' => "$data['lun'] == 1 ? 'si' : ' '",

Thankss!! Yes the problem was about simple quote and double.

I can work with

'value'=>'$data["lun"] == 1 ? "Si" : " " ',

Thanks Again.

greeting from Argentina.


Great… remember $data->something is used for objects (CActivDataProvider) and $data[‘something’] is used with arrays (CSqlDataprovider, CArrayDataProvider)