當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CakePlugin::routes方法代碼示例

本文整理匯總了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';
開發者ID:jeykamihal,項目名稱:sigepevu,代碼行數:31,代碼來源: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'));
 }
開發者ID:hupla78,項目名稱:Nadia,代碼行數:17,代碼來源:CakePluginTest.php

示例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;
 }
開發者ID:pritten,項目名稱:SmartCitizen.me,代碼行數:17,代碼來源:ConsoleShell.php

示例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';
開發者ID:josephbergdoll,項目名稱:berrics,代碼行數:31,代碼來源:admin_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;
 }
開發者ID:Nervie,項目名稱:Beta,代碼行數:23,代碼來源:ConsoleShell.php

示例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();
 }
開發者ID:ahmadhasankhan,項目名稱:croogo,代碼行數:15,代碼來源:CroogoRouter.php

示例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';
開發者ID:NetCommons3,項目名稱:NetCommons3,代碼行數:31,代碼來源:routes.php


注:本文中的CakePlugin::routes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。