nod.st / cakephp-controllers-list
此软件包最新版本(v0.1.4)没有可用的许可证信息。
CakePHP 控制器列表
v0.1.4
2013-09-06 22:30 UTC
Requires
- php: >=5.3.0
- composer/installers: *
This package is not auto-updated.
Last update: 2024-09-23 14:54:50 UTC
README
插件包含用于生成组织化控制器列表的组件,支持包含、排除、排序和缓存选项。
要求
- CakePHP 2.1.0 或更高版本。
下载
- 点击这里
- 或使用 Git
- 子模块
$ 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
安装
- 在引导程序中加载插件
- 在您的控制器中定义组件。
###示例
<?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 )); ?>
###其他选项
<?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 ); ?>