nod.st/cakephp-controllers-list

CakePHP Controllers List

Installs: 7

Dependents: 1

Stars: 1

Watchers: 1

Forks: 1

Language: PHP

v0.1.4 2013-09-06 22:30 UTC

README

A plugin contains component for generating organized controllers list with include,exclude,order,sort and cache options.

Requirements

  • CakePHP 2.1.0 or greater.

Download

$ git submodule add https://github.com/JacopKane/Cake-ControllersList.git path/to/Plugins/ControllersList```
    * Clone:

$ git submodule add https://github.com/JacopKane/Cake-ControllersList.git /path/to/Plugins/ControllersList```

Installation

  • Load the plugin at bootstrap
  • Define the component at your controller.

Example:

<?php
//Config/bootstrap.php
CakePlugin::load('ControllersList'));

//Controller/AppController.php
public $components = array('ControllersList.GetList' => array(
        'exclude'                   => array('Pages'),
        'plugins_exclude'           => array('DebugKit', 'CakeFoo'),
        'order_by'                  => 'order',
        'cache'                     => false
));
?>

Other Options:

<?php
array(
    'cache'                     => true,                    //must use especially if order sorting is enabled
    'log'                       => true,                    //if enabled, it'll log it, everytime new cache created
    'set_disable'               => false,                   //enable to pass list as a variable to the view
    'set_variable'              => 'controllersList',       //variable name for getting controller lists in views
    'exclude_currentController' => false,                   //exclude current controller
    'exclude_appControllers'    => true,                    //exclude AppController and PluginAppControllers
    'exclude'                   => array(),                 //for excluding some extra controller names
    'include'                   => array(),                 //for including some extra controller names
    'order_sort'                => 'desc',                  //desc or asc sorting
    'order_by'                  => 'name',                  //sort by name or order
    'order_disabled'            => false,                   //for using this sorting you can add a "$order" property in your controller. enabling cache for this deadly recommended.
    'plugins_disable'           => false,                   //don't scan plugins
    'plugins_exclude'           => array(),                 //for excluding some extra plugin's controller
    'plugins_include'           => array()                  //for including some extra plugin's controller
);
?>