obtain $data from $DataProvider

Hello People, I need your help.

I have the following code:


<?php 

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

            'id' => 'sucursal-grid',

            'dataProvider' => $DataProviderSemanas,            

            'columns' => array(                                                                                                  

                array(

                    'name' => 'lun',

                    'header'=>'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:


$raw['id']=(int)$SemanaTrabajo{'id'};

                $raw['nrosemana']=$SemanaTrabajo{'nrosemana'};

                $raw['lun']=$value{'lun'};

                $raw['mar']=$value{'mar'};

                $raw['mie']=$value{'mie'};

                $raw['jue']=$value{'jue'};

                $raw['vie']=$value{'vie'};

                $raw['sab']=$value{'sab'};

                $raw['dom']=$value{'dom'};

Thanks Very much for your help!!

Marcos

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.

Marcos

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