1 | <?php |
||
19 | trait SemanticHtmlElementsTrait { |
||
20 | /** |
||
21 | * Return a new Semantic Html Button |
||
22 | * @param string $identifier |
||
23 | * @param string $value |
||
24 | * @param string $cssStyle |
||
25 | * @param string $onClick |
||
26 | * @return HtmlButton |
||
27 | */ |
||
28 | public function htmlButton($identifier, $value="", $cssStyle=null, $onClick=null) { |
||
31 | |||
32 | /** |
||
33 | * @param string $identifier |
||
34 | * @param array $elements |
||
35 | * @param boolean $asIcons |
||
36 | * @return HtmlButtonGroups |
||
37 | */ |
||
38 | public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){ |
||
41 | |||
42 | /** |
||
43 | * Creates an html container |
||
44 | * @param string $identifier |
||
45 | * @param string $content |
||
46 | * @return HtmlContainer |
||
47 | */ |
||
48 | public function htmlContainer($identifier,$content=""){ |
||
51 | |||
52 | /** |
||
53 | * @param string $identifier |
||
54 | * @param string $content |
||
55 | * @return HtmlDivider |
||
56 | */ |
||
57 | public function htmlDivider($identifier,$content="",$tagName="div"){ |
||
60 | |||
61 | /** |
||
62 | * @param string $identifier |
||
63 | * @param number $niveau |
||
64 | * @param mixed $content |
||
65 | * @param string $type |
||
66 | * @return HtmlHeader |
||
67 | */ |
||
68 | public function htmlHeader($identifier,$niveau=1,$content=NULL,$type="page"){ |
||
71 | |||
72 | /** |
||
73 | * @param string $identifier |
||
74 | * @param string $icon |
||
75 | * @return HtmlIcon |
||
76 | */ |
||
77 | public function htmlIcon($identifier,$icon){ |
||
80 | |||
81 | /** |
||
82 | * @param string $identifier |
||
83 | * @param string $size |
||
84 | * @param array $icons |
||
85 | * @return HtmlIconGroups |
||
86 | */ |
||
87 | public function htmlIconGroups($identifier,$size="",$icons=array()){ |
||
100 | |||
101 | /** |
||
102 | * |
||
103 | * @param string $identifier |
||
104 | * @param string $type |
||
105 | * @param string $value |
||
106 | * @param string $placeholder |
||
107 | * @return HtmlInput |
||
108 | */ |
||
109 | public function htmlInput($identifier,$type="text",$value="",$placeholder=""){ |
||
112 | |||
113 | /** |
||
114 | * @param string $identifier |
||
115 | * @param string $content |
||
116 | * @param string $tagName |
||
117 | * @return HtmlLabel |
||
118 | */ |
||
119 | public function htmlLabel($identifier,$content="",$tagName="div"){ |
||
122 | |||
123 | /** |
||
124 | * |
||
125 | * @param string $identifier |
||
126 | * @param array $items |
||
127 | * @return HtmlList |
||
128 | */ |
||
129 | public function htmlList($identifier,$items=array()){ |
||
132 | |||
133 | /** |
||
134 | * Adds a new segment, used to create a grouping of related content |
||
135 | * @param string $identifier |
||
136 | * @param string $content |
||
137 | * @return HtmlSegment |
||
138 | */ |
||
139 | public function htmlSegment($identifier, $content=""){ |
||
142 | |||
143 | /** |
||
144 | * Adds a group of segments |
||
145 | * @param string $identifier |
||
146 | * @param array $items the segments |
||
147 | * @return HtmlSegmentGroups |
||
148 | */ |
||
149 | public function htmlSegmentGroups($identifier, $items=array()){ |
||
152 | } |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.