nod.st/cakephp-controllers-list

此软件包最新版本(v0.1.4)没有可用的许可证信息。

CakePHP 控制器列表

安装: 19

依赖者: 1

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 2

类型:cakephp-plugin

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

This package is not auto-updated.

Last update: 2024-09-23 14:54:50 UTC


README

插件包含用于生成组织化控制器列表的组件,支持包含、排除、排序和缓存选项。

要求

  • CakePHP 2.1.0 或更高版本。

下载

$ 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
);
?>