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
d252677f
Commit
d252677f
authored
Sep 07, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed get_script and get_style from asset class.
parent
d82a3f41
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
29 deletions
+5
-29
asset.php
laravel/asset.php
+5
-27
AssetTest.php
tests/AssetTest.php
+0
-2
No files found.
laravel/asset.php
View file @
d252677f
...
@@ -197,7 +197,7 @@ class Asset_Container {
...
@@ -197,7 +197,7 @@ class Asset_Container {
*/
*/
public
function
styles
()
public
function
styles
()
{
{
return
$this
->
g
et_g
roup
(
'style'
);
return
$this
->
group
(
'style'
);
}
}
/**
/**
...
@@ -207,7 +207,7 @@ class Asset_Container {
...
@@ -207,7 +207,7 @@ class Asset_Container {
*/
*/
public
function
scripts
()
public
function
scripts
()
{
{
return
$this
->
g
et_g
roup
(
'script'
);
return
$this
->
group
(
'script'
);
}
}
/**
/**
...
@@ -216,7 +216,7 @@ class Asset_Container {
...
@@ -216,7 +216,7 @@ class Asset_Container {
* @param string $group
* @param string $group
* @return string
* @return string
*/
*/
protected
function
g
et_g
roup
(
$group
)
protected
function
group
(
$group
)
{
{
if
(
!
isset
(
$this
->
assets
[
$group
])
or
count
(
$this
->
assets
[
$group
])
==
0
)
return
''
;
if
(
!
isset
(
$this
->
assets
[
$group
])
or
count
(
$this
->
assets
[
$group
])
==
0
)
return
''
;
...
@@ -224,34 +224,12 @@ class Asset_Container {
...
@@ -224,34 +224,12 @@ class Asset_Container {
foreach
(
$this
->
arrange
(
$this
->
assets
[
$group
])
as
$name
=>
$data
)
foreach
(
$this
->
arrange
(
$this
->
assets
[
$group
])
as
$name
=>
$data
)
{
{
$assets
.=
$this
->
get_
asset
(
$group
,
$name
);
$assets
.=
$this
->
asset
(
$group
,
$name
);
}
}
return
$assets
;
return
$assets
;
}
}
/**
* Get the link to a single registered CSS asset.
*
* @param string $name
* @return string
*/
public
function
get_style
(
$name
)
{
return
$this
->
get_asset
(
'style'
,
$name
);
}
/**
* Get the link to a single registered JavaScript asset.
*
* @param string $name
* @return string
*/
public
function
get_script
(
$name
)
{
return
$this
->
get_asset
(
'script'
,
$name
);
}
/**
/**
* Get the HTML link to a registered asset.
* Get the HTML link to a registered asset.
*
*
...
@@ -259,7 +237,7 @@ class Asset_Container {
...
@@ -259,7 +237,7 @@ class Asset_Container {
* @param string $name
* @param string $name
* @return string
* @return string
*/
*/
protected
function
get_
asset
(
$group
,
$name
)
protected
function
asset
(
$group
,
$name
)
{
{
if
(
!
isset
(
$this
->
assets
[
$group
][
$name
]))
return
''
;
if
(
!
isset
(
$this
->
assets
[
$group
][
$name
]))
return
''
;
...
...
tests/AssetTest.php
View file @
d252677f
...
@@ -70,7 +70,6 @@ class AssetTest extends PHPUnit_Framework_TestCase {
...
@@ -70,7 +70,6 @@ class AssetTest extends PHPUnit_Framework_TestCase {
$container
->
style
(
'reset'
,
'css/reset.css'
);
$container
->
style
(
'reset'
,
'css/reset.css'
);
$container
->
style
(
'jquery'
,
'css/jquery.css'
);
$container
->
style
(
'jquery'
,
'css/jquery.css'
);
$this
->
assertEquals
(
$container
->
get_style
(
'reset'
),
'css/reset.css media:all'
);
$this
->
assertEquals
(
$container
->
styles
(),
'css/reset.css media:allcss/jquery.css media:all'
);
$this
->
assertEquals
(
$container
->
styles
(),
'css/reset.css media:allcss/jquery.css media:all'
);
}
}
...
@@ -81,7 +80,6 @@ class AssetTest extends PHPUnit_Framework_TestCase {
...
@@ -81,7 +80,6 @@ class AssetTest extends PHPUnit_Framework_TestCase {
$container
->
script
(
'jquery-ui'
,
'js/jquery-ui.js'
);
$container
->
script
(
'jquery-ui'
,
'js/jquery-ui.js'
);
$container
->
script
(
'jquery'
,
'js/jquery.js'
,
array
(),
array
(
'test'
=>
'value'
));
$container
->
script
(
'jquery'
,
'js/jquery.js'
,
array
(),
array
(
'test'
=>
'value'
));
$this
->
assertEquals
(
$container
->
get_script
(
'jquery-ui'
),
'js/jquery-ui.js '
);
$this
->
assertEquals
(
$container
->
scripts
(),
'js/jquery-ui.js js/jquery.js test:value'
);
$this
->
assertEquals
(
$container
->
scripts
(),
'js/jquery-ui.js js/jquery.js test:value'
);
}
}
...
...
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