Making plugin routes load after app routes, closes #1722

This commit is contained in:
Jose Lorenzo Rodriguez 2011-05-22 21:50:56 -04:30
parent 95a5b99b0e
commit 5b8865a3a7
5 changed files with 22 additions and 10 deletions

View file

@ -53,10 +53,10 @@ class ConsoleShell extends Shell {
public function initialize() {
App::uses('Dispatcher', 'Routing');
$this->Dispatcher = new Dispatcher();
$this->models = App::objects('model');
$this->models = App::objects('Model');
foreach ($this->models as $model) {
$class = Inflector::camelize(str_replace('.php', '', $model));
$class = $model;
$this->models[$model] = $class;
App::uses($class, 'Model');
$this->{$class} = new $class();
@ -123,7 +123,7 @@ class ConsoleShell extends Shell {
$out .= "\t)";
$out .= "\n";
$out .= 'Alternatively, you can use simple array syntax to test reverse';
$out .= 'To reload your routes config (config/routes.php), do the following:';
$out .= 'To reload your routes config (Config/routes.php), do the following:';
$out .= "\n";
$out .= "\tRoutes reload";
$out .= "\n";
@ -342,6 +342,8 @@ class ConsoleShell extends Shell {
if (!@include(APP . 'Config' . DS . 'routes.php')) {
return false;
}
CakePlugin::routes();
Router::parse('/');
foreach (array_keys(Router::getNamedExpressions()) as $var) {