getName() . '.php'; if(isset($_SESSION['admin']) && $_SESSION['admin'] && file_exists($viewFile)) { /*if(!empty($node->getNodeData()->getData())) { extract($node->getNodeData()->getData()); }*/ $this->unfoldOptions(Director::$menu_data); ob_start(); require $viewFile; // insertion de $this->html généré par unfoldMenu $this->html = ob_get_clean(); // pas de concaténation .= cette fois on écrase } else{ header('Location: ' . new URL); die; } } private function unfoldOptions(Page $page): void { foreach($page->getChildren() as $entry){ $this->options .= '\n"; if(count($entry->getChildren()) > 0){ $this->unfoldOptions($entry); } } } }