Ejemplo n.º 1
1
 *
 * 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';
Ejemplo n.º 2
0
 /**
  * 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'));
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }
Ejemplo n.º 4
0
 /**
  * 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());
     //@codingStandardsIgnoreStart
     if (!@(include APP . 'Config' . DS . 'routes.php')) {
         //@codingStandardsIgnoreEnd
         return false;
     }
     CakePlugin::routes();
     Router::parse('/');
     return true;
 }
Ejemplo n.º 5
0
 *
 * @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';
Ejemplo n.º 6
0
 /**
  * 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;
 }
Ejemplo n.º 7
0
 /**
  * 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();
 }
Ejemplo n.º 8
0
 * @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';