Fixes
This commit is contained in:
parent
71d361e071
commit
11b0d243ff
|
@ -297,9 +297,7 @@ public static function assets($bundle)
|
||||||
{
|
{
|
||||||
if (is_null($bundle)) return static::assets(DEFAULT_BUNDLE);
|
if (is_null($bundle)) return static::assets(DEFAULT_BUNDLE);
|
||||||
|
|
||||||
$server = Config::get('application.asset_url', URL::base() );
|
return ($bundle != DEFAULT_BUNDLE) ? "/bundles/{$bundle}/" : '/';
|
||||||
|
|
||||||
return ($bundle != DEFAULT_BUNDLE) ? $server."/bundles/{$bundle}/" : $server.'/';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -220,6 +220,18 @@ protected static function convention($action, $parameters)
|
||||||
*/
|
*/
|
||||||
public static function to_asset($url, $https = null)
|
public static function to_asset($url, $https = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// If the URL is already well-formed, just return it
|
||||||
|
if (static::valid($url)) return $url;
|
||||||
|
|
||||||
|
// If a base asset URL is defined in the configuration, use that and
|
||||||
|
// don't try and change links to http/https.
|
||||||
|
if ($root = Config::get('application.asset_url', false )) {
|
||||||
|
|
||||||
|
return rtrim($root, '/').'/'.ltrim($url, '/');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (is_null($https)) $https = Request::secure();
|
if (is_null($https)) $https = Request::secure();
|
||||||
|
|
||||||
$url = static::to($url, $https);
|
$url = static::to($url, $https);
|
||||||
|
|
Loading…
Reference in New Issue