1 | <?php |
||
10 | class Content implements Renderable |
||
11 | { |
||
12 | /** |
||
13 | * Content title. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $title = ' '; |
||
18 | |||
19 | /** |
||
20 | * Content description. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $description = ' '; |
||
25 | |||
26 | /** |
||
27 | * Page breadcrumb. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $breadcrumb = []; |
||
32 | |||
33 | /** |
||
34 | * @var Row[] |
||
35 | */ |
||
36 | protected $rows = []; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $view; |
||
42 | |||
43 | /** |
||
44 | * Content constructor. |
||
45 | * |
||
46 | * @param Closure|null $callback |
||
47 | */ |
||
48 | public function __construct(\Closure $callback = null) |
||
54 | |||
55 | /** |
||
56 | * Alias of method `title`. |
||
57 | * |
||
58 | * @param string $header |
||
59 | * |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function header($header = '') |
||
66 | |||
67 | /** |
||
68 | * @param string $title |
||
69 | * |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function title($title) |
||
78 | |||
79 | /** |
||
80 | * Set description of content. |
||
81 | * |
||
82 | * @param string $description |
||
83 | * |
||
84 | * @return $this |
||
85 | */ |
||
86 | public function description($description = '') |
||
92 | |||
93 | /** |
||
94 | * Set breadcrumb of content. |
||
95 | * |
||
96 | * @param array ...$breadcrumb |
||
97 | * |
||
98 | * @return $this |
||
99 | */ |
||
100 | public function breadcrumb(...$breadcrumb) |
||
108 | |||
109 | /** |
||
110 | * Validate content breadcrumb. |
||
111 | * |
||
112 | * @param array $breadcrumb |
||
113 | * |
||
114 | * @throws \Exception |
||
115 | * |
||
116 | * @return bool |
||
117 | */ |
||
118 | protected function validateBreadcrumb(array $breadcrumb) |
||
128 | |||
129 | /** |
||
130 | * Alias of method row. |
||
131 | * |
||
132 | * @param mixed $content |
||
133 | * |
||
134 | * @return $this |
||
135 | */ |
||
136 | public function body($content) |
||
140 | |||
141 | /** |
||
142 | * Add one row for content body. |
||
143 | * |
||
144 | * @param $content |
||
145 | * |
||
146 | * @return $this |
||
147 | */ |
||
148 | public function row($content) |
||
160 | |||
161 | /** |
||
162 | * Render giving view as content body. |
||
163 | * |
||
164 | * @param string $view |
||
165 | * @param array $data |
||
166 | * |
||
167 | * @return $this |
||
168 | */ |
||
169 | public function view($view, $data = []) |
||
175 | |||
176 | /** |
||
177 | * @param string $view |
||
178 | * @param array $data |
||
179 | */ |
||
180 | public function component($view, $data = []) |
||
184 | |||
185 | /** |
||
186 | * @param $var |
||
187 | * |
||
188 | * @return $this |
||
189 | */ |
||
190 | public function dump($var) |
||
194 | |||
195 | /** |
||
196 | * Add Row. |
||
197 | * |
||
198 | * @param Row $row |
||
199 | */ |
||
200 | protected function addRow(Row $row) |
||
204 | |||
205 | /** |
||
206 | * Build html of content. |
||
207 | * |
||
208 | * @return string |
||
209 | */ |
||
210 | public function build() |
||
224 | |||
225 | /** |
||
226 | * Set success message for content. |
||
227 | * |
||
228 | * @param string $title |
||
229 | * @param string $message |
||
230 | * |
||
231 | * @return $this |
||
232 | */ |
||
233 | public function withSuccess($title = '', $message = '') |
||
239 | |||
240 | /** |
||
241 | * Set error message for content. |
||
242 | * |
||
243 | * @param string $title |
||
244 | * @param string $message |
||
245 | * |
||
246 | * @return $this |
||
247 | */ |
||
248 | public function withError($title = '', $message = '') |
||
254 | |||
255 | /** |
||
256 | * Set warning message for content. |
||
257 | * |
||
258 | * @param string $title |
||
259 | * @param string $message |
||
260 | * |
||
261 | * @return $this |
||
262 | */ |
||
263 | public function withWarning($title = '', $message = '') |
||
269 | |||
270 | /** |
||
271 | * Set info message for content. |
||
272 | * |
||
273 | * @param string $title |
||
274 | * @param string $message |
||
275 | * |
||
276 | * @return $this |
||
277 | */ |
||
278 | public function withInfo($title = '', $message = '') |
||
284 | |||
285 | /** |
||
286 | * @return array |
||
287 | */ |
||
288 | protected function getUserData() |
||
296 | |||
297 | /** |
||
298 | * Render this content. |
||
299 | * |
||
300 | * @return string |
||
301 | */ |
||
302 | public function render() |
||
315 | } |
||
316 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.