YII "dataProvider" Column Use Controller Function.



admin.php

'filter'=>$model,
...........................
...........................
'columns'=>array(
     array(
     "name"=>"shop_type",
     'htmlOptions'=>array('style'=>'text-align:left'),
     'type' => 'raw',
     'value'=>array($this,'getShopInfo'),
     )
),


controller:

public function getShopInfo($data){
          $html = '<span>'.t('shop',$data->shop_type).'</span>';
          return $html;
}


Share on Google Plus

About Ram Pukar

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment