diff --git a/public/index.php b/public/index.php index 362b7ff..2a40915 100644 --- a/public/index.php +++ b/public/index.php @@ -1,4 +1,5 @@ new self($b), $beans); + return array_map(fn (OODBBean $b) => new self($b), $beans); } /* ------------------------------------------------- @@ -74,12 +75,27 @@ class Post ACCESSEURS / MUTATEURS ------------------------------------------------- */ - public function getId(): int { return (int) $this->bean->id; } - public function getTitle(): string { return (string) $this->bean->title; } - public function getContent(): string { return (string) $this->bean->content; } + public function getId(): int + { + return (int) $this->bean->id; + } + public function getTitle(): string + { + return (string) $this->bean->title; + } + public function getContent(): string + { + return (string) $this->bean->content; + } - public function setTitle(string $title): void { $this->bean->title = $title; } - public function setContent(string $content): void { $this->bean->content = $content; } + public function setTitle(string $title): void + { + $this->bean->title = $title; + } + public function setContent(string $content): void + { + $this->bean->content = $content; + } /* ------------------------------------------------- MISE À JOUR À PARTIR D'UN TABLEAU diff --git a/src/Routes/admin.routes.php b/src/Routes/admin.routes.php index 81a6eba..416c0ab 100644 --- a/src/Routes/admin.routes.php +++ b/src/Routes/admin.routes.php @@ -1,4 +1,5 @@ get('/', [PostController::class, 'index']); + // Page d'accueil – liste des articles + $app->get('/', [PostController::class, 'index']); };