Skip to content

Commit

Permalink
Pluralize App.paths.* keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 11, 2013
1 parent 9db777e commit 77d0a1e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions App/App/Config/app.php.default
Expand Up @@ -48,8 +48,8 @@ $config = [
'cssBaseUrl' => 'css/',
'jsBaseUrl' => 'js/',
'paths' => [
'plugin' => [ROOT . '/Plugin/'],
'view' => [APP . 'View/'],
'plugins' => [ROOT . '/Plugin/'],
'views' => [APP . 'View/'],
],
],

Expand Down
14 changes: 6 additions & 8 deletions lib/Cake/Core/App.php
Expand Up @@ -26,11 +26,9 @@
*
* ### Adding paths
*
* You can add paths to the search indexes App uses to find resources using `App::build()`. Adding
* additional view paths for example would alter where CakePHP looks for view files.
*
* You can only add paths for Views and Locale files. All class based resources should be mapped
* using your application's autoloader.
* Additional paths for Views and Plugins are configured with Configure now. See App/Config/app.php for an
* example. The `App.paths.plugins` and `App.paths.views` variables are used to configure paths for plugins
* and views respectively. All class based resources should be mapped using your application's autoloader.
*
* ### Inspecting loaded paths
*
Expand Down Expand Up @@ -115,7 +113,7 @@ public static function classname($class, $type = '', $suffix = '') {
* `App::path('Plugin');`
*
* Will return the configured paths for plugins. This is a simpler way to access
* the `App.paths.plugin` configure variable.
* the `App.paths.plugins` configure variable.
*
* `App::path('Model/Datasource', 'MyPlugin');`
*
Expand All @@ -128,10 +126,10 @@ public static function classname($class, $type = '', $suffix = '') {
*/
public static function path($type, $plugin = null) {
if ($type === 'Plugin') {
return (array)Configure::read('App.paths.plugin');
return (array)Configure::read('App.paths.plugins');
}
if (empty($plugin) && $type === 'View') {
return (array)Configure::read('App.paths.view');
return (array)Configure::read('App.paths.views');
}
if (!empty($plugin)) {
return [static::pluginPath($plugin) . $type . DS];
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/init.php
Expand Up @@ -71,7 +71,7 @@
'jsBaseUrl' => 'js/',
'cssBaseUrl' => 'css/',
'paths' => [
'plugin' => [TEST_APP . 'Plugin/'],
'plugins' => [TEST_APP . 'Plugin/'],
'views' => [TEST_APP . 'View/']
]
]);
Expand Down

0 comments on commit 77d0a1e

Please sign in to comment.