Quantcast
Channel: admin – Cakephp Example
Viewing all articles
Browse latest Browse all 10

How to add BreadCrumbs in Cakephp ?

$
0
0

Cakephp has built in BreadCrumbs Helper. Which we can use easily in Cakephp site. Follow the bellow steps to use Cakephp breadcrumb helper.

1) Open your layout file and add the following code where you want to add the breadcrumb.

<div class="breadcrumb">
    <?php
    echo $this->Html->getCrumbs(' > ', 'Home');
    ?>
</div>

2) Now add the breadcrumb items in all your view file such as in group add file we can add bellow code

<?php
      $this->Html->addCrumb('Groups',  '/groups') ;
      $this->Html->addCrumb('Add Group' ,  '' , array('class' => 'active'));
 ?>

3) Styles your breadcrumb. Add the following css code in your any css file.

.breadcrumb {background: rgba(245, 245, 245, 1); border: 0px solid rgba(245, 245, 245, 1); border-radius: 4px; display: block;}
.breadcrumb a{font-size: 14px;}
.breadcrumb a {color: rgba(66, 139, 202, 1);}
.breadcrumb a:hover {color: rgba(42, 100, 150, 1);}
.breadcrumb>.active {color: rgba(153, 153, 153, 1);}

Viewing all articles
Browse latest Browse all 10

Trending Articles