You are viewing revision #1 of this wiki article.
This is the latest version of this article.
1: Create breadcrumb in your view file.
$this->breadcrumbs=array(
'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(
'links'=>$this->breadcrumbs,
'homeLink'=>false,
'tagName'=>'ul',
'separator'=>'',
'activeLinkTemplate'=>'<li><a href="{url}">{label}</a> <span class="divider">/</span></li>',
'inactiveLinkTemplate'=>'<li><span>{label}</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>
</ul>
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.