Reputation: 1153
Im using CHtml::link()
for attachment in my grid view and if i click on it, it will open in new tab to display.
My doubt is how can i use font awesome icon to display attachment in grid. Currently it showing from table but i want to display <i class="fa fa-paperclip" aria-hidden="true"></i>
this icon for that column.
array(
'name' => 'invoice_attachment',
'value' => 'CHtml::link($data->invoice_attachment, Yii::app()->request->baseUrl.$data->invoice_attachment, array("target"=>"_blank"))',
'type' => 'raw',
),
The above code is my current output for link.
Upvotes: 1
Views: 493
Reputation: 5032
CHtml::link($text, $url, $htmlOptions)
method accepts 3 parameters:
$text
- this is what you want, right now youre setting here $data->invoice_attachment
(propably file name) - change this to your <i>
string$url
- a URL or an action route that can be used to create a URL$htmlOptions
- additional HTML attributesChange $text
param and that's all.
Upvotes: 3