Browse Source

Configuration option to set different server for asset files.

Colin Viebrock 12 years ago
parent
commit
71d361e071
2 changed files with 17 additions and 1 deletions
  1. 14 0
      application/config/application.php
  2. 3 1
      laravel/bundle.php

+ 14 - 0
application/config/application.php

@@ -15,6 +15,20 @@ return array(
 
 	'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

+ 3 - 1
laravel/bundle.php

@@ -297,7 +297,9 @@ class 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.'/';
 	}
 
 	/**