Yii hide buttons of a CButtonColumn / TbButtonColumn

When you are using the CButtonColumn or TbButtonColumn and you want to hide a particular link you have to set the template attribute. You can also use this approach to change the order of the icons. See example below:

$this->widget('bootstrap.widgets.TbGridView', array(
	'type'=>'striped bordered condensed',
		array('name'=>'year', 'header'=>'Jaar'),
			'template'=>'{update} {delete}' //removed {view}

After writing this post I came across this post which will explain it more in detail:


Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>