Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
48dae0c3
Commit
48dae0c3
authored
Apr 30, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #578 from cviebrock/asset-url
Configuration option to set different base URL for assets
parents
55913070
95dc06ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
application.php
application/config/application.php
+14
-0
bundle.php
laravel/bundle.php
+1
-1
url.php
laravel/url.php
+12
-0
No files found.
application/config/application.php
View file @
48dae0c3
...
...
@@ -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
...
...
laravel/bundle.php
View file @
48dae0c3
...
...
@@ -297,7 +297,7 @@ class Bundle {
{
if
(
is_null
(
$bundle
))
return
static
::
assets
(
DEFAULT_BUNDLE
);
return
(
$bundle
!=
DEFAULT_BUNDLE
)
?
URL
::
base
()
.
"/bundles/
{
$bundle
}
/"
:
URL
::
base
()
.
'/'
;
return
(
$bundle
!=
DEFAULT_BUNDLE
)
?
"/bundles/
{
$bundle
}
/"
:
'/'
;
}
/**
...
...
laravel/url.php
View file @
48dae0c3
...
...
@@ -220,6 +220,18 @@ class URL {
*/
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
();
$url
=
static
::
to
(
$url
,
$https
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment