st3ph / cakephp-breadcrumb
CakePHP 3.x plugin to handle Breadcrumb
Installs: 813
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 3
Open Issues: 1
Type:cakephp-plugin
Requires
- php: >=5.4.16
- cakephp/cakephp: ~3.0
Requires (Dev)
- cakephp/cakephp-codesniffer: dev-master
- phpunit/phpunit: 5.3.*
This package is not auto-updated.
Last update: 2025-01-30 03:29:15 UTC
README
===============================================
CakePHP-breadcrumb is here to help you manage your breadcrumbs
It is compatible with CakePHP 3 only.
Installing with Composer
The package is available on Packagist. You can install it using this Composer command in the root of your project:
composer require st3ph/cakephp-breadcrumb
# In config/bootstrap.php Plugin::load('Breadcrumb');
# In src/Controller/AppController.php (or any controller) public function initialize() { parent::initialize(); $this->loadComponent('Breadcrumb.Breadcrumb'); }
Loading the Helper:
# In View/AppView.php public function initialize() { parent::initialize(); $this->loadHelper('Breadcrumb', ['className' => 'Breadcrumb.Breadcrumb']); }
Configuration
None, yet.
Usage
Controllers
$this->Breadcrumb->push([ 'title' => 'Awesome title', 'url' => Router::url(['controller' => 'MyController', 'action' => 'MyAction']), ]);
Views
The plugin automatically create a view variable with the breadcrumb array in the beforeRender event named $BreadCrumbCrumbs.
echo $this->Breadcrumb->display($BreadCrumbCrumbs);