Moving core view to the new folder and allowing the view class to find those views

This commit is contained in:
José Lorenzo Rodríguez 2010-12-05 13:07:01 -04:30
parent 0596f5a245
commit c542ac20c9
37 changed files with 8 additions and 7 deletions

View file

@ -330,7 +330,7 @@ class App {
static $paths = false; static $paths = false;
if (!$paths) { if (!$paths) {
$paths = array(); $paths = array();
$libs = dirname(__FILE__) . DS; $libs = LIBS;
$cake = dirname($libs) . DS; $cake = dirname($libs) . DS;
$path = dirname($cake) . DS; $path = dirname($cake) . DS;
@ -341,7 +341,7 @@ class App {
$paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS; $paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS;
$paths['controllers'][] = $libs . 'controller' . DS; $paths['controllers'][] = $libs . 'controller' . DS;
$paths['components'][] = $libs . 'controller' . DS . 'components' . DS; $paths['components'][] = $libs . 'controller' . DS . 'components' . DS;
$paths['views'][] = $libs . 'view' . DS; $paths['views'][] = $libs . 'View' . DS;
$paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS; $paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS;
$paths['plugins'][] = $path . 'plugins' . DS; $paths['plugins'][] = $path . 'plugins' . DS;
$paths['vendors'][] = $path . 'vendors' . DS; $paths['vendors'][] = $path . 'vendors' . DS;

View file

@ -140,11 +140,11 @@ class ClassRegistry {
if (class_exists($class)) { if (class_exists($class)) {
${$class} = new $class($settings); ${$class} = new $class($settings);
} elseif ($type === 'Model') { } elseif ($type === 'Model') {
//if ($plugin && class_exists($plugin . 'AppModel')) { if ($plugin && class_exists($plugin . 'AppModel')) {
// $appModel = $plugin . 'AppModel'; $appModel = $plugin . 'AppModel';
//} else { } else {
$appModel = 'AppModel'; $appModel = 'AppModel';
//} }
$settings['name'] = $class; $settings['name'] = $class;
${$class} = new $appModel($settings); ${$class} = new $appModel($settings);
} }

View file

@ -811,7 +811,8 @@ class View extends Object {
} }
$paths[] = App::pluginPath($plugin) . 'views' . DS; $paths[] = App::pluginPath($plugin) . 'views' . DS;
} }
$this->__paths = array_merge($paths, $viewPaths);
$this->__paths = array_merge($paths, $viewPaths, array_flip($corePaths));
return $this->__paths; return $this->__paths;
} }
} }