Sona Rijesh
Sona Rijesh

Reputation: 1035

Button Link in Yii

This is a CButtonColumn configuration in a Yii grid:

array(
    'class' => 'CButtonColumn',
    'template' => '<div class="actions-box">{edit}{views}{print}{print_contract}{print1}{addendum}</div>',
    'buttons' => array(
        'addendum' => array(
            'label' => '<i class="fa fa-print" style="color:grey"></i>',
            'options' => array(
                'title' => 'Addendum',
                'target' => '_blank',
            ),
            'url' => '"http://www.google.com"', 
        ),
    ),
),

When clicking the "Addendum" button, it should navigate to Google. Now it opens in a new tab, but it does not go to Google. When I inspect the element, I get this output

<a title="<i class=&quot;fa fa-print&quot; style=&quot;color:grey&quot;></i>" href="#"><i class="fa fa-print" style="color:grey"></i></a>

Please help.

Thanks

Upvotes: 1

Views: 17

Answers (1)

Harry B
Harry B

Reputation: 2971

Looking at the relevant documentation for button detail...

Label is a 'text label' for the button. It's injected into the 'title' attribute. That will generally show when you hover the button.

So you can only use text in that value, not html as you have above.

Upvotes: 0

Related Questions