PHP code example of k1low / breadcrumb
1. Go to this page and download the library: Download k1low/breadcrumb library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
k1low / breadcrumb example snippets
class PostsController extends AppController
{
public $components = [
'Breadcrumb.Breadcrumb',
];
public function beforeFilter()
{
parent::beforeFilter();
$this->Breadcrumb->append('Mypage', ['controller' => 'users', 'action' => 'mypage']);
}
public function add()
{
...
$this->Breadcrumb->append('List Post', ['controller' => 'posts', 'action' => 'index']);
$this->Breadcrumb->append('Add post');
}
}
echo $this->element('Breadcrumb.breadcrumb');