1 | <?php |
||
15 | trait Template |
||
16 | { |
||
17 | /** Template */ |
||
18 | protected $_template = null; |
||
19 | /** Data */ |
||
20 | protected $_data = null; |
||
21 | /** Default Template */ |
||
22 | protected $_defaultTemplate = 'default'; |
||
23 | /** Default Template Root Folder */ |
||
24 | protected $_templateRootFolder = null; |
||
25 | /** Template Folder */ |
||
26 | protected $_templateFolder = null; |
||
27 | |||
28 | /** |
||
29 | * Constructor like initiation |
||
30 | * @param string $template , Theme Object (Contaier) |
||
31 | * @param mixed $data |
||
32 | */ |
||
33 | public function initiate($template = null, $data = null, $templateRootFolder = ERDIKO_APP) |
||
40 | |||
41 | /** |
||
42 | * Set template |
||
43 | * |
||
44 | * @param string $template |
||
45 | */ |
||
46 | public function setTemplate($template) |
||
50 | |||
51 | /** |
||
52 | * Get template |
||
53 | * |
||
54 | * @param string $template |
||
|
|||
55 | */ |
||
56 | public function getTemplate() |
||
60 | |||
61 | /** |
||
62 | * Get default template name |
||
63 | * |
||
64 | * @param string $template |
||
65 | */ |
||
66 | public function getDefaultTemplate() |
||
70 | |||
71 | /** |
||
72 | * Set default template name |
||
73 | * |
||
74 | * @param string $template |
||
75 | */ |
||
76 | public function setDefaultTemplate($template) |
||
80 | |||
81 | /** |
||
82 | * Set template root folder |
||
83 | * |
||
84 | * @param string $TemplateRootFolder |
||
85 | */ |
||
86 | public function setTemplateRootFolder($templateRootFolder) |
||
90 | |||
91 | /** |
||
92 | * Set data |
||
93 | * |
||
94 | * @param mixed $data , data injected into the container |
||
95 | */ |
||
96 | public function setData($data) |
||
100 | |||
101 | /** |
||
102 | * Get data |
||
103 | * |
||
104 | * @return mixed $data , data injected into the container |
||
105 | */ |
||
106 | public function getData() |
||
110 | |||
111 | /** |
||
112 | * Get Template folder |
||
113 | */ |
||
114 | public function getTemplateFolder() |
||
118 | |||
119 | /** |
||
120 | * Set Template folder |
||
121 | */ |
||
122 | public function setTemplateFolder($templateFolder) |
||
126 | |||
127 | public function renderMustache($filename, $data) |
||
133 | |||
134 | /** |
||
135 | * Get rendered template file |
||
136 | * Accepts one of the types of template files in this order: |
||
137 | * php (.php), html/mustache (.html), markdown (.md) |
||
138 | * |
||
139 | * @param string $filename , file without extension |
||
140 | * @param array $data , associative array of data |
||
141 | * @throws \Exception , template file does not exist |
||
142 | */ |
||
143 | public function getTemplateFile($filename, $data) |
||
160 | |||
161 | public function __set($key, $value) |
||
171 | |||
172 | public function __get($key) |
||
181 | |||
182 | /** |
||
183 | * Render container to HTML |
||
184 | * |
||
185 | * @return string $html |
||
186 | */ |
||
187 | public function toHtml() |
||
194 | |||
195 | /** |
||
196 | * toString magic method. |
||
197 | * When casting to a string use the toHtml method to determine how to render |
||
198 | */ |
||
199 | public function __toString() |
||
203 | } |
||
204 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.