Social Icons

Pages

Thursday, May 23, 2013

cgridview value from functions

 In CGridView,  a column where  want to modify the value with a getter function from a model I have loaded. 
view Cgridview

'columns'=>array(
                .............
                array(
                     'name'=>'subject',
                     'type'=>'raw',
                        'value'=>array($model,'subjectFormated'), 
                ),
            .........................
),

in model function subjectFormated()

public static function subjectFormated($model){
       ////will get model->subject 
.....your code...................
}

3 comments: