corso https://vola.udemy.com/course/php-mvc-from-scratch/learn/lecture/40931984#overview
filippo.bertilotti
2024-05-14 2bddb6faf9aeddf40602187c57c421da8ded5c3e
src/App/Controllers/products.php
@@ -1,18 +1,24 @@
<?php
namespace App\Controllers;
use App\Models\Product;
use Framework\Viewer;
class Products {
    public function __construct(private Viewer $viewer, private Product $model) { }
    public function index() {
        $products = $this->model->getData();
        $model = new Product;
        $products = $model->getData();
        require "views/products_index.php";
        echo $this->viewer->render("shared/header.php");
        echo $this->viewer->render("Products/index.php", [
            "products"=> $products
        ]);
    }
    public function show(string $id) {
        var_dump($id);
        require "views/products_show.php";
        echo $this->viewer->render("shared/header.php");
        echo $this->viewer->render("Products/show.php", [
            "id"=> $id
        ]);
    }
    public function showPage(string $title, string $id, string $page) {