aboutsummaryrefslogtreecommitdiff
path: root/src/View/CalendarBuilder.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/View/CalendarBuilder.php')
-rw-r--r--src/View/CalendarBuilder.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/View/CalendarBuilder.php b/src/View/CalendarBuilder.php
new file mode 100644
index 0000000..34b1952
--- /dev/null
+++ b/src/View/CalendarBuilder.php
@@ -0,0 +1,31 @@
1<?php
2// src/View/CalendarBuilder.php
3
4declare(strict_types=1);
5
6namespace App\View;
7
8use App\Entity\Node;
9
10class CalendarBuilder extends AbstractBuilder
11{
12 public function __construct(Node $node)
13 {
14 parent::__construct($node);
15 $viewFile = self::VIEWS_PATH . $node->getName() . '.php';
16
17 $calendar_js_file = IS_ADMIN ? 'calendar_admin' : 'calendar';
18
19 if(file_exists($viewFile))
20 {
21 if(!empty($node->getNodeData()->getData()))
22 {
23 extract($node->getNodeData()->getData());
24 }
25
26 ob_start();
27 require $viewFile;
28 $this->html = ob_get_clean(); // pas de concaténation ici, on écrase
29 }
30 }
31} \ No newline at end of file