This commit is contained in:
Sam Georges 2014-05-16 16:10:29 +10:00
parent dc5e55b4c0
commit 43b3455f75
2 changed files with 17 additions and 1 deletions

View File

@ -326,7 +326,7 @@ class Controller extends Extendable
* Detect assets
*/
if ($this->hasAssetsDefined()) {
$responseContents['X_OCTOBER_ASSETS'] = $this->assets;
$responseContents['X_OCTOBER_ASSETS'] = $this->getAssetPaths();
}
return Response::make()->setContent($responseContents);

View File

@ -139,6 +139,22 @@ trait AssetMaker
$this->assets['rss'][] = ['path' => $rssPath, 'attributes' => $attributes];
}
/**
* Returns an array of all registered asset paths.
* @return array
*/
public function getAssetPaths()
{
$assets = [];
foreach ($this->assets as $type => $collection) {
$assets[$type] = [];
foreach ($collection as $asset) {
$assets[$type][] = $asset['path'];
}
}
return $assets;
}
/**
* Locates a file based on it's definition. If the file starts with
* a forward slash, it will be returned in context of the application public path,