Configuration option to set different server for asset files.

This commit is contained in:
Colin Viebrock 2012-04-23 22:48:16 -05:00
parent 94948cf675
commit 71d361e071
2 changed files with 17 additions and 1 deletions

View File

@ -15,6 +15,20 @@
'url' => '', 'url' => '',
/*
|--------------------------------------------------------------------------
| Asset URL
|--------------------------------------------------------------------------
|
| The base URL used for your application's asset files, if you are serving
| them through a different server or a content delivery network, for
| example. If it's not set, we'll default to the application URL (above).
| Leave off the trailing slash.
|
*/
'asset_url' => '',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Index | Application Index

View File

@ -297,7 +297,9 @@ public static function assets($bundle)
{ {
if (is_null($bundle)) return static::assets(DEFAULT_BUNDLE); if (is_null($bundle)) return static::assets(DEFAULT_BUNDLE);
return ($bundle != DEFAULT_BUNDLE) ? URL::base()."/bundles/{$bundle}/" : URL::base().'/'; $server = Config::get('application.asset_url', URL::base() );
return ($bundle != DEFAULT_BUNDLE) ? $server."/bundles/{$bundle}/" : $server.'/';
} }
/** /**