Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
23ccc0a6
Commit
23ccc0a6
authored
Sep 21, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added better comments to the asset class.
parent
7f5d047e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
laravel/asset.php
+29
-0
No files found.
laravel/asset.php
View file @
23ccc0a6
...
...
@@ -12,6 +12,14 @@ class Asset {
/**
* Get an asset container instance.
*
* <code>
* // Get the default asset container
* $container = Asset::container();
*
* // Get a named asset container
* $container = Asset::container('footer');
* </code>
*
* @param string $container
* @return Asset_Container
*/
...
...
@@ -27,6 +35,14 @@ class Asset {
/**
* Magic Method for calling methods on the default Asset container.
*
* <code>
* // Call the "styles" method on the default container
* echo Asset::styles();
*
* // Call the "add" method on the default container
* Asset::add('jquery', 'js/jquery.js');
* </code>
*/
public
static
function
__callStatic
(
$method
,
$parameters
)
{
...
...
@@ -70,6 +86,17 @@ class Asset_Container {
* asset being registered (CSS or JavaScript). If you are using a non-standard
* extension, you may use the style or script methods to register assets.
*
* <code>
* // Add an asset to the container
* Asset::container()->add('jquery', 'js/jquery.js');
*
* // Add an asset that has dependencies on other assets
* Asset::add('jquery', 'js/jquery.js', 'jquery-ui');
*
* // Add an asset that should have attributes applied to its tags
* Asset::add('jquery', 'js/jquery.js', null, array('defer'));
* </code>
*
* @param string $name
* @param string $source
* @param array $dependencies
...
...
@@ -134,6 +161,8 @@ class Asset_Container {
{
$dependencies
=
(
array
)
$dependencies
;
$attributes
=
(
array
)
$attributes
;
$this
->
assets
[
$type
][
$name
]
=
compact
(
'source'
,
'dependencies'
,
'attributes'
);
}
...
...
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