Simple category plugin for CakePHP.
- CakePHP 2.5.x or later
- Admin CRUD, sorting order
Put your app plugin directory as Category
.
In 2.0 you need to enable the plugin your app/Config/bootstrap.php file:
<?php
CakePlugin::load('Category', array('bootstrap' => false, 'routes' => true));
?>
In your app directory type:
Console/cake schema update -p Category
- Example of creating nested link in view:
<?php
echo $this->Category->nestedCategories($categories, array(
'link' => true,
'tag' => 'ul',
'tagAttributes' => null,
'plugin' => 'Category',
'controller' => 'categories',
'action' = 'view',
));
?>
$categories
is assigned with $this->Category->find('threaded', array('order' => array('Category.lft' => 'ASC')));
The MIT License (MIT)