diff --git a/src/Controller/Admin/DashboardController.php b/src/Controller/Admin/DashboardController.php new file mode 100644 index 0000000..b2e9007 --- /dev/null +++ b/src/Controller/Admin/DashboardController.php @@ -0,0 +1,39 @@ +redirect($this->adminUrlGenerator->setController(ProductCrudController::class)->generateUrl()); + } + + public function configureDashboard(): Dashboard + { + return Dashboard::new() + ->setTitle('IceCold'); + } + + public function configureMenuItems(): iterable + { +// yield MenuItem::linktoRoute('Back to home', 'fas fa-home', 'home'); + + yield MenuItem::section('Products', 'fas fa-folder-open'); + yield MenuItem::linkToDashboard('Dashboard', 'fa fa-home'); + yield MenuItem::linkToCrud('Products', 'fas fa-list', Product::class); + } +} diff --git a/src/Controller/Admin/ProductCrudController.php b/src/Controller/Admin/ProductCrudController.php new file mode 100644 index 0000000..0521f64 --- /dev/null +++ b/src/Controller/Admin/ProductCrudController.php @@ -0,0 +1,36 @@ +render('base.html.twig'); + return $this->render('base/base.html.twig'); } } \ No newline at end of file diff --git a/src/Entity/Product.php b/src/Entity/Product.php index 5daba94..57ff2ef 100644 --- a/src/Entity/Product.php +++ b/src/Entity/Product.php @@ -20,7 +20,7 @@ class Product private $name; #[ORM\Column(type: 'text', nullable: true)] - private $Description; + private $description; public function getId(): ?int { @@ -41,12 +41,12 @@ class Product public function getDescription(): ?string { - return $this->Description; + return $this->description; } - public function setDescription(?string $Description): self + public function setDescription(?string $description): self { - $this->Description = $Description; + $this->description = $description; return $this; } diff --git a/templates/base.html.twig b/templates/base/base.html.twig similarity index 58% rename from templates/base.html.twig rename to templates/base/base.html.twig index aca8ed3..900466b 100644 --- a/templates/base.html.twig +++ b/templates/base/base.html.twig @@ -16,25 +16,7 @@ {% endblock %} - +{% include 'base/navbar.html.twig' %}
{% block body %} {% endblock %} diff --git a/templates/base/navbar.html.twig b/templates/base/navbar.html.twig new file mode 100644 index 0000000..9858a79 --- /dev/null +++ b/templates/base/navbar.html.twig @@ -0,0 +1,19 @@ + \ No newline at end of file