Difference between #4 and #3 of Yii CGridView add custom button

unchanged
Title
Yii CGridView add custom button
unchanged
Category
How-tos
unchanged
Tags
CGridView, custom button for CGridView, custom button
unchanged
Content
Hi buddies !,
This tutorial shows about how to add a custom button with your own icon for your
CGridView of Yii framework

**Step 1** 
Add a new array element under 'class' => 'CButtonColumn'

as follow The default buttons are

~~~
[php]
'template' => '{view}{update}{delete}',
~~~
Now I am adding a new button for reply

~~~
[php]
'template' => '{reply}{view}{update}{delete}',
~~~

**Step 2** Then add a new element in the name **reply** under button array as
follows


~~~
[php]
'buttons' => array(
               'reply' => array( //the name {reply} must be same
                 'label' => 'Reply', // text label of the
button
                   'url' =>
'CHtml::normalizeUrl(array("dashboard/mail/id/".rawurlencode($data->feedback_email)."/f_id/".$data->feedback_id))',
//Your URL According to your wish
                      'imageUrl' => Yii::app()->baseUrl .
'/images/reply_mail_icon.png', // image URL of the button. If not set
or false, a text link is used, The image must be 16X16 pixels
                   ),
               ),
~~~


For more field definitions of buttons array check 
[CButtonColumn](http://www.yiiframework.com/doc/api/1.1/CButtonColumn#buttons-detail
"CButtonColumn")