tweak url for languages.

This commit is contained in:
Taylor Otwell 2012-07-11 10:30:44 -05:00
parent 10e5918e23
commit e19e4ebd24
1 changed files with 13 additions and 0 deletions

View File

@ -107,6 +107,14 @@ public static function to($url = '', $https = null)
$root = static::base().'/'.Config::get('application.index');
// If multiple languages are being supported via URIs, we will append current
// language to the URI so all redirects and URLs generated include the
// current language so it is not lost on further requests.
if (count(Config::get('application.languages')) > 0)
{
$root .= '/'.Config::get('application.language');
}
// Since SSL is not often used while developing the application, we allow the
// developer to disable SSL on all framework generated links to make it more
// convenient to work with the site while developing locally.
@ -242,6 +250,11 @@ public static function to_asset($url, $https = null)
$url = str_replace($index.'/', '', $url);
}
if (count(Config::get('application.languages')) > 0)
{
$url = str_replace(Config::get('application.language').'/', '', $url);
}
return $url;
}