corso https://vola.udemy.com/course/php-mvc-from-scratch/learn/lecture/40931984#overview
filippo.bertilotti
2024-05-13 6f9729324df24d53635e44e70dc4fecb30ab8180
commit | author | age
026ec0 1 <?php
c042bc 2 namespace App\Controllers;
5cc38b 3 use App\Models\Product;
157da9 4 use Framework\Viewer;
c54720 5 class Products {
026ec0 6     public function index() {
be68f1 7
5cc38b 8         $model = new Product;
026ec0 9         $products = $model->getData();
F 10
157da9 11         $viewer = new Viewer;
6f9729 12         $viewer->render("products_index.php", $products);
026ec0 13     }
2e7bc3 14
a93a2f 15     public function show(string $id) {
F 16         var_dump($id);
2e7bc3 17         require "views/products_show.php";
F 18     }
1f822b 19
F 20     public function showPage(string $title, string $id, string $page) {
1e5093 21         echo $title, " ", $id, " ", $page;
1f822b 22     }
026ec0 23 }