1 | <?php |
||
23 | class ContainerRenderer implements ContainerRendererInterface |
||
24 | { |
||
25 | const WIDGET_CLASS = 'swp_widget'; |
||
26 | |||
27 | /** |
||
28 | * @var ContainerInterface |
||
29 | */ |
||
30 | protected $containerEntity; |
||
31 | |||
32 | /** |
||
33 | * @var \Twig_Environment |
||
34 | */ |
||
35 | protected $renderer; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $widgets = []; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $cacheDir; |
||
46 | |||
47 | /** |
||
48 | * @var bool |
||
49 | */ |
||
50 | protected $debug; |
||
51 | |||
52 | /** |
||
53 | * ContainerRenderer constructor. |
||
54 | * |
||
55 | * @param ContainerInterface $containerEntity |
||
56 | * @param \Twig_Environment|null $renderer |
||
57 | * @param bool $debug |
||
58 | * @param null $cacheDir |
||
59 | */ |
||
60 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * Set Widgets. |
||
77 | * |
||
78 | * @param array $widgets |
||
79 | * |
||
80 | * @return self |
||
81 | */ |
||
82 | public function setWidgets($widgets) |
||
88 | |||
89 | /** |
||
90 | * Render open tag for container. |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | public function renderOpenTag() |
||
104 | |||
105 | /** |
||
106 | * Check if container has items. |
||
107 | * |
||
108 | * @return bool |
||
109 | */ |
||
110 | public function hasWidgets() |
||
118 | |||
119 | /** |
||
120 | * Go through widgets render them and collect output of rendering. |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | public function renderWidgets() |
||
140 | |||
141 | /** |
||
142 | * Check if container is visible. |
||
143 | * |
||
144 | * @return bool |
||
145 | */ |
||
146 | public function isVisible() |
||
150 | |||
151 | /** |
||
152 | * Render close tag for container. |
||
153 | * |
||
154 | * @return string |
||
155 | */ |
||
156 | public function renderCloseTag() |
||
160 | |||
161 | /** |
||
162 | * @return \Twig_Environment |
||
163 | */ |
||
164 | private function getRenderer() |
||
181 | } |
||
182 |