Twitter Bootstrap style Breadcrumbs

You are viewing revision #1 of this wiki article.
This is the latest version of this article.

1: Create breadcrumb in your view file.

    'Junaid Atari'=>array('user/main', 'id'=>12),
	'Change Password',

2: Update the code in /layouts/main.php

<?php if(isset($this->breadcrumbs)):
	if ( Yii::app()->controller->route !== 'site/index' )
		$this->breadcrumbs = array_merge(array (Yii::t('zii','Home')=>Yii::app()->homeUrl), $this->breadcrumbs);
	$this->widget('zii.widgets.CBreadcrumbs', array(
		'activeLinkTemplate'=>'<li><a href="{url}">{label}</a> <span class="divider">/</span></li>',
		'htmlOptions'=>array ('class'=>'breadcrumb')
	)); ?><!-- breadcrumbs -->
	<?php endif; ?>

will generate twitter bootstrap styled breadcrumb code:

<ul class="breadcrumb">
	<li><a href="site/index">Home</a> <span class="divider">/</span></li>
	<li><a href="user/main/id/12">Junaid Atari</a> <span class="divider">/</span></li>
	<li><span>Change Password</span></li>
3 1
Viewed: 26 110 times
Version: Unknown (update)
Category: How-tos
Written by: junaidatari
Last updated by: junaidatari
Created on: Feb 6, 2013
Last updated: 8 years ago
Update Article


View all history

Related Articles