Wednesday, December 4, 2013

Yii CGridView - add External Link

How to add external link to CGridView
Add external link to cgridview blogspot

<?php $this->widget('zii.widgets.grid.CGridView', array(
 'id'=>'leads-grid',
 'dataProvider'=>$model->search(),
 'filter'=>$model,
 'columns'=>array(
  'id',
  // 'lead_id',
  array(
   'name' => 'lead_id',
   'type' => 'raw',
   'value' => 'CHtml::link(CHtml::encode($data->lead_id), "http://www.justrefer.co.uk/pages/justECO/default.aspx?leadID=".CHtml::encode($data->lead_id))',
  ),  
  'agent_name',
  'brokerReference',
  'title',
  'firstNames',
  /*
  'lastName',
  'emailAddress',
  'telNumber',
  'mobile',
  'income',
  'bestTimeToCall',
  'notes',
  'BoilerCheck',
  'CavityCheck',
  'LoftCheck',
  'PropertyType',
  'address1',
  'address2',
  'address3',
  'address4',
  'postcode',
  'dateEntered',
  'lengthAtAddress',
  'propertyOwnerShip',
  'landlord_title',
  'landlord_firstNames',
  'landlord_lastName',
  'landlord_emailAddress',
  'landlord_telNumber',
  'landlord_mobile',
  'landlord_address1',
  'landlord_address2',
  'landlord_address3',
  'landlord_address4',
  'landlord_postcode',
  */
  array(
   'class'=>'CButtonColumn',
  ),
 ),
)); ?>