This repository was archived by the owner on Feb 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhtml.attributes.php
More file actions
147 lines (145 loc) · 3.53 KB
/
Copy pathhtml.attributes.php
File metadata and controls
147 lines (145 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
/**
* HTML attributes give elements meaning and context.
* The global attributes below can be used on any HTML element
*
* Included New global attributes in HTML5.
*
* @package PHP2HTML
* @subpackage HTML
* @version 1.0 BETA
* @author MANUEL GONZALEZ RIVERA <phptohtml@gmail.com>
* @copyright Copyright (R) 2012, MANUEL GONZALEZ RIVERA <phptohtml@gmail.com>
* @license http://opensource.org/licenses/MIT MIT
*/
/**
* The accesskey attribute specifies a shortcut key to activate/focus an element.
* <element accesskey="character">
*
* @param string $var
* @return string
*/
function acckey($var){
return ($var=='' ? '' : ' accesskey="'.$var.'"');
}
/**
* The class attribute is supported in all major browsers.
*
* <element class="classname">
*
* @param string $var
* @return string
*/
function cClass($var){
return ($var=='' ? '' : ' class="'.$var.'"');
}
/**
* The dir attribute specifies the text direction of the element's content.
* <element dir="ltr|rtl|auto">
*
* @param string $var
* @return string
*/
function dir_text($var='auto'){
return ($var=='' ? '' : ' dir="'.$var.'"');
}
/**
* The contenteditable attribute is supported in all major browsers.
* HTML5 attribute
* <element contenteditable="true|false|inherit">
*
* @param string $var
* @return string
*/
function contEdit($var=''){
return($var=='' ? '' : ' contenteditable="'.$var.'"');
}
/**
* The draggable attribute specifies whether an element is draggable or not.
* HTML5 attribute
* <element draggable="true|false|auto">
*
* @param string $var
* @return string
*/
function dragg($var=''){
return($var=='' ? '' : ' draggable="'.$var.'"');
}
/**
* Specifies that an element is not yet, or is no longer, relevant
* HTML5 attribute
* <element hidden>
*
* @param string $var
* @return string
*/
function hidden($var=''){
return($var=='' ? '' : ' hidden');
}
/**
* The id attribute specifies a unique id for an HTML element
* (the value must be unique within the HTML document).
* <element id="id">
*
* @param string $var
* @return string
*/
function id($var=''){
return ($var=='' ? '' : ' id="'.$var.'"');
}
/**
* The lang attribute specifies the language of the element's content.
* <element lang="language_code">
*
* @param string $var
* @return string
*/
function lang($var=''){
return ($var=='' ? '' : ' lang="'.$var.'"');
}
/**
* The spellcheck attribute specifies whether the element is to have its spelling and grammar checked or not.
* The following can be spellchecked:
* Text values in input elements (not password)
* Text in textarea elements
* Text in editable elements
* HTML5 attribute
* <element spellcheck="true|false">
*
* @param string $var
* @return string
*/
function spellCheck($var=''){
return($var=='' ? '' : ' spellcheck="'.$var.'"');
}
/**
* The style attribute specifies an inline style for an element.
* <element style="style_definitions">
*
* @param string $var
* @return string
*/
function style($var='') {
return ($var=='' ? '' : ' style="'.$var.'"');
}
/**
* The tabindex attribute specifies the tab order of an element (when the "tab" button is used for navigating).
* <element tabindex="number">
*
* @param string $var
* @return string
*/
function tabIndex($var=0){
return($var==0 ? '' : ' tabindex="'.$var.'"');
}
/**
* The title attribute specifies extra information about an element.
* <element title="text">
*
* @param string $var
* @return string
*/
function title($var=''){
return($var=='' ? '' : ' title="'.$var.'"');
}
?>