1 | <?php |
||
4 | class Section |
||
5 | { |
||
6 | /** |
||
7 | * do not render section if the section has this value. |
||
8 | */ |
||
9 | const NO_SECTION_RENDER = false; |
||
10 | |||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | private $section_data = []; |
||
15 | |||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | private $ob_level = 0; |
||
20 | |||
21 | /** |
||
22 | * start capturing a section. |
||
23 | */ |
||
24 | public function start() |
||
29 | |||
30 | /** |
||
31 | * end capture with name. |
||
32 | * |
||
33 | * @param $name |
||
34 | */ |
||
35 | public function saveAs($name) |
||
43 | |||
44 | /** |
||
45 | * get a captured section. |
||
46 | * |
||
47 | * @param string $name |
||
48 | * @return string |
||
49 | */ |
||
50 | public function get($name) |
||
54 | |||
55 | /** |
||
56 | * @param string $name |
||
57 | * @param string|mixed $data |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function set($name, $data) |
||
66 | |||
67 | /** |
||
68 | * @param string $name |
||
69 | */ |
||
70 | public function markNotToRender($name) |
||
74 | |||
75 | /** |
||
76 | * @param string $name |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function exists($name) |
||
90 | |||
91 | /** |
||
92 | * render the part of template as $name section. |
||
93 | * will not render if the section is marked as NO_RENDER |
||
94 | * |
||
95 | * @param string $name |
||
96 | */ |
||
97 | public function renderAs($name) |
||
105 | |||
106 | /** |
||
107 | * render the part of a template only if section $name does not exist. |
||
108 | * |
||
109 | * @param string $name |
||
110 | */ |
||
111 | public function replaceBy($name) |
||
125 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.