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
5862faf2
Commit
5862faf2
authored
Aug 08, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring the html class.
parent
d1934b73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
html.php
system/html.php
+8
-15
No files found.
system/html.php
View file @
5862faf2
...
...
@@ -34,12 +34,11 @@ class HTML {
*/
public
static
function
style
(
$url
,
$attributes
=
array
())
{
if
(
!
array_key_exists
(
'media'
,
$attributes
))
{
$attributes
[
'media'
]
=
'all'
;
}
if
(
!
array_key_exists
(
'media'
,
$attributes
))
$attributes
[
'media'
]
=
'all'
;
$attributes
=
$attributes
+
array
(
'rel'
=>
'stylesheet'
,
'type'
=>
'text/css'
);
return
'<link href="'
.
static
::
entities
(
URL
::
to_asset
(
$url
))
.
'"
rel="stylesheet" type="text/css"
'
.
static
::
attributes
(
$attributes
)
.
'>'
.
PHP_EOL
;
return
'<link href="'
.
static
::
entities
(
URL
::
to_asset
(
$url
))
.
'"'
.
static
::
attributes
(
$attributes
)
.
'>'
.
PHP_EOL
;
}
/**
...
...
@@ -148,10 +147,7 @@ class HTML {
{
$email
=
static
::
email
(
$email
);
if
(
is_null
(
$title
))
{
$title
=
$email
;
}
if
(
is_null
(
$title
))
$title
=
$email
;
return
'<a href="mailto:'
.
$email
.
'"'
.
static
::
attributes
(
$attributes
)
.
'>'
.
static
::
entities
(
$title
)
.
'</a>'
;
}
...
...
@@ -240,10 +236,7 @@ class HTML {
{
// Assume numeric-keyed attributes to have the same key and value.
// Example: required="required", autofocus="autofocus", etc.
if
(
is_numeric
(
$key
))
{
$key
=
$value
;
}
if
(
is_numeric
(
$key
))
$key
=
$value
;
if
(
!
is_null
(
$value
))
{
...
...
@@ -292,17 +285,17 @@ class HTML {
*/
public
static
function
__callStatic
(
$method
,
$parameters
)
{
// Handle the dynamic creation of links to secure routes.
if
(
strpos
(
$method
,
'link_to_secure_'
)
===
0
)
{
array_unshift
(
$parameters
,
substr
(
$method
,
15
));
return
forward_static_call_array
(
'HTML::link_to_secure_route'
,
$parameters
);
}
// Handle the dynamic creation of links to routes.
if
(
strpos
(
$method
,
'link_to_'
)
===
0
)
{
array_unshift
(
$parameters
,
substr
(
$method
,
8
));
return
forward_static_call_array
(
'HTML::link_to_route'
,
$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