We are going to deploy the new yiiframework.com website on March 23, 2018 from 8:00 to 12:00 UTC.
Website and Yii documentation will not be available in this time frame. Check the news for more details.

Yii 1.1: Twitter Bootstrap style Breadcrumbs


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>

Be the first person to leave a comment

Please to leave your comment.

Write new article