Yii CGridView hyperlink open in new tab
问题 I have made one column of my yii CGridview as a hyperlink. But on clicking it, it opens link address within the same tab. How can I open the link address in a new tab ? array( 'header'=>'Name', 'name' => 'name', 'value' => 'CHtml::link($data->name, $data->site_url)', 'type' => 'raw', ), 回答1: Set the target attribute as _blank for the link ( <a> ) that will be generated: <a href="some_url" target="_blank">Foo</a> With CHtml::link : 'value' => 'CHtml::link($data->name, $data->site_url, array(