From c67078f88f7b00dd8e963989337f576f70531339 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 15 Jul 2018 08:59:24 +0200 Subject: [PATCH] Added login\register as dropbox --- src/controller/AbstractDefaultController.php | 5 +++-- src/router/link/LinkCollection.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controller/AbstractDefaultController.php b/src/controller/AbstractDefaultController.php index 95c5665..73d3c75 100644 --- a/src/controller/AbstractDefaultController.php +++ b/src/controller/AbstractDefaultController.php @@ -3,6 +3,7 @@ namespace controller; use router\link\Link; use router\Router; +use router\link\LinkCollection; /** * This controllers render the frames/default.html.twig @@ -53,7 +54,7 @@ class AbstractDefaultController extends AbstractController ], 'logout') ]; } - return [ + return [new LinkCollection('login',[ new Link([ Router::CONTROLLER => 'user', Router::ACTION => 'login' @@ -62,7 +63,7 @@ class AbstractDefaultController extends AbstractController Router::CONTROLLER => 'user', Router::ACTION => 'register' ], 'register') - ]; + ])]; } } diff --git a/src/router/link/LinkCollection.php b/src/router/link/LinkCollection.php index 3c4da2c..779883b 100644 --- a/src/router/link/LinkCollection.php +++ b/src/router/link/LinkCollection.php @@ -15,7 +15,8 @@ final class LinkCollection extends ArrayCollection implements LinkCollectionInte */ private $name; - public function __construct(string $name){ + public function __construct(string $name,?array $links = []){ + parent::__construct($links); $this->name = $name; }