本文整理汇总了PHP中CakePlugin::routes方法的典型用法代码示例。如果您正苦于以下问题:PHP CakePlugin::routes方法的具体用法?PHP CakePlugin::routes怎么用?PHP CakePlugin::routes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakePlugin
的用法示例。
在下文中一共展示了CakePlugin::routes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v 0.2.9
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
/**
* Here, we are connecting '/' (base path) to controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
* to use (in this case, /app/View/Pages/home.ctp)...
*/
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
/**
* ...and connect the rest of 'Pages' controller's URLs.
*/
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
/**
* Load all plugin routes. See the CakePlugin documentation on
* how to customize the loading of plugin routes.
*/
CakePlugin::routes();
/**
* Load the CakePHP default routes. Only remove this if you do not want to use
* the built-in default routes.
*/
require CAKE . 'Config' . DS . 'routes.php';
示例2: testLoadAllWithDefaultsAndOverrideComplex
/**
* Tests that CakePlugin::loadAll() will load all plugins in the configured folder with defaults
* and overrides for a plugin
*
* @return void
*/
public function testLoadAllWithDefaultsAndOverrideComplex()
{
CakePlugin::loadAll(array(array('bootstrap' => true), 'TestPlugin' => array('routes' => true, 'bootstrap' => false)));
CakePlugin::routes();
$expected = array('PluginJs', 'TestPlugin', 'TestPluginTwo');
$this->assertEquals($expected, CakePlugin::loaded());
$this->assertEquals('loaded js plugin bootstrap', Configure::read('CakePluginTest.js_plugin.bootstrap'));
$this->assertEquals('loaded plugin routes', Configure::read('CakePluginTest.test_plugin.routes'));
$this->assertEquals(null, Configure::read('CakePluginTest.test_plugin.bootstrap'));
$this->assertEquals('loaded plugin two bootstrap', Configure::read('CakePluginTest.test_plugin_two.bootstrap'));
}
示例3: _loadRoutes
/**
* Reloads the routes configuration from app/Config/routes.php, and compiles
* all routes found
*
* @return boolean True if config reload was a success, otherwise false
*/
protected function _loadRoutes()
{
Router::reload();
extract(Router::getNamedExpressions());
if (!@(include APP . 'Config' . DS . 'routes.php')) {
return false;
}
CakePlugin::routes();
Router::parse('/');
return true;
}
示例4: array
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Here, we are connecting '/' (base path) to controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
* to use (in this case, /app/View/Pages/home.ctp)...
*/
Router::connect('/', array('controller' => 'home', 'action' => 'index'));
/**
* ...and connect the rest of 'Pages' controller's urls.
*/
//Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
Router::connect("/theberrics.ics", array("controller" => "dashboard", "action" => "cal"));
Router::connect("/dashboard/reports", array("plugin" => "bq_reports", "controller" => "dashboard"));
Router::connect("/dashboard/reports/:controller/:action/*", array("plugin" => "bq_reports"));
/**
* Load all plugin routes. See the CakePlugin documentation on
* how to customize the loading of plugin routes.
*/
CakePlugin::loadAll(array("Unified" => array("routes" => true)));
CakePlugin::routes('Unified');
/**
* Load the CakePHP default routes. Remove this if you do not want to use
* the built-in default routes.
*/
require CAKE . 'Config' . DS . 'routes.php';
示例5: _loadRoutes
/**
* Reloads the routes configuration from app/Config/routes.php, and compiles
* all routes found
*
* @return boolean True if config reload was a success, otherwise false
*/
protected function _loadRoutes()
{
Router::reload();
extract(Router::getNamedExpressions());
if (!@(include APP . 'Config' . DS . 'routes.php')) {
return false;
}
CakePlugin::routes();
Router::parse('/');
foreach (array_keys(Router::getNamedExpressions()) as $var) {
unset(${$var});
}
foreach (Router::$routes as $route) {
$route->compile();
}
return true;
}
示例6: routes
/**
* Setup Site.home_url
*
* @return void
*/
public static function routes()
{
$homeUrl = Configure::read('Site.home_url');
if ($homeUrl && strpos($homeUrl, ':') !== false) {
$converter = new StringConverter();
$url = $converter->linkStringToArray($homeUrl);
CroogoRouter::connect('/', $url, array(), array('promote' => true));
}
CakePlugin::routes();
}
示例7: array
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v 0.2.9
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
if (!Configure::read('NetCommons.installed')) {
Router::connect('/', array('controller' => 'install', 'action' => 'index', 'plugin' => 'install'));
/**
* Load all plugin routes. See the CakePlugin documentation on
* how to customize the loading of plugin routes.
*/
CakePlugin::routes();
} else {
Router::connect('/', array('controller' => 'pages', 'action' => 'index', 'plugin' => 'pages'));
/**
* Load all plugin routes. See the CakePlugin documentation on
* how to customize the loading of plugin routes.
*/
$plugins = CakePlugin::loaded();
foreach ($plugins as $value) {
if (!in_array($value, ['NetCommons'], true)) {
CakePlugin::routes($value);
}
}
CakePlugin::routes('NetCommons');
}
/**
* Load the CakePHP default routes. Only remove this if you do not want to use
* the built-in default routes.
*/
require CAKE . 'Config' . DS . 'routes.php';