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
efed3b6e
Commit
efed3b6e
authored
Sep 22, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comments to html class.
parent
122dff97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
4 deletions
+47
-4
html.php
laravel/html.php
+47
-4
No files found.
laravel/html.php
View file @
efed3b6e
...
...
@@ -16,7 +16,15 @@ class HTML {
}
/**
* Generate a JavaScript reference.
* Generate a link to a JavaScript file.
*
* <code>
* // Generate a link to a JavaScript file
* echo HTML::script('js/jquery.js');
*
* // Generate a link to a JavaScript file and add some attributes
* echo HTML::script('js/jquery.js', array('defer'));
* </code>
*
* @param string $url
* @param array $attributes
...
...
@@ -30,10 +38,18 @@ class HTML {
}
/**
* Generate a
CSS referenc
e.
* Generate a
link to a CSS fil
e.
*
* If no media type is selected, "all" will be used.
*
* <code>
* // Generate a link to a CSS file
* echo HTML::style('css/common.css');
*
* // Generate a link to a CSS file and add some attributes
* echo HTML::style('css/common.css', array('media' => 'print'));
* </code>
*
* @param string $url
* @param array $attributes
* @return string
...
...
@@ -62,6 +78,14 @@ class HTML {
/**
* Generate a HTML link.
*
* <code>
* // Generate a link to a location within the application
* echo HTML::link('user/profile', 'User Profile');
*
* // Generate a link to a location outside of the application
* echo HTML::link('http://google.com', 'Google');
* </code>
*
* @param string $url
* @param string $title
* @param array $attributes
...
...
@@ -122,6 +146,14 @@ class HTML {
*
* An array of parameters may be specified to fill in URI segment wildcards.
*
* <code>
* // Generate a link to the "profile" named route
* echo HTML::link_to_route('profile', 'Profile');
*
* // Generate a link to the "profile" route and add some parameters
* echo HTML::link_to_route('profile', 'Profile', array('taylor'));
* </code>
*
* @param string $name
* @param string $title
* @param array $parameters
...
...
@@ -248,7 +280,7 @@ class HTML {
{
$html
=
array
();
foreach
(
$attributes
as
$key
=>
$value
)
foreach
(
(
array
)
$attributes
as
$key
=>
$value
)
{
// Assume numeric-keyed attributes to have the same key and value.
// Example: required="required", autofocus="autofocus", etc.
...
...
@@ -269,7 +301,7 @@ class HTML {
* @param string $value
* @return string
*/
p
ublic
static
function
obfuscate
(
$value
)
p
rotected
static
function
obfuscate
(
$value
)
{
$safe
=
''
;
...
...
@@ -300,6 +332,17 @@ class HTML {
* Magic Method for handling dynamic static methods.
*
* This method primarily handles dynamic calls to create links to named routes.
*
* <code>
* // Generate a link to the "profile" named route
* echo HTML::link_to_profile('Profile');
*
* // Generate a link to the "profile" route and add some parameters
* echo HTML::link_to_profile('Profile', array('taylor'));
*
* // Generate a link to the "profile" named route using HTTPS
* echo HTML::link_to_secure_profile('Profile');
* </code>
*/
public
static
function
__callStatic
(
$method
,
$parameters
)
{
...
...
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