Skip to content

Commit

Permalink
Using App::themePath inside Dispatcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 1, 2010
1 parent 91f8e22 commit 16cae72
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions cake/dispatcher.php
Expand Up @@ -584,14 +584,10 @@ function asset($url) {
$themeName = $parts[1];
unset($parts[0], $parts[1]);
$fileFragment = implode('/', $parts);

$viewPaths = App::path('views');
foreach ($viewPaths as $viewPath) {
$path = $viewPath . 'themed' . DS . $themeName . DS . 'webroot' . DS;
if (file_exists($path . $fileFragment)) {
$assetFile = $path . $fileFragment;
break;
}

$path = App::themePath($themeName) . 'webroot' . DS;
if (file_exists($path . $fileFragment)) {
$assetFile = $path . $fileFragment;
}
} else {
$plugin = $parts[0];
Expand Down Expand Up @@ -648,7 +644,6 @@ function _deliverAsset($assetFile, $ext) {
include($assetFile);
} else {
ob_clean();
flush();
readfile($assetFile);
}

Expand Down

0 comments on commit 16cae72

Please sign in to comment.