corso https://vola.udemy.com/course/php-mvc-from-scratch/learn/lecture/40931984#overview
filippo.bertilotti
2024-05-13 8fdeaaff9e2e6862cb3c9825522b51453a0340f6
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;
bf18c7 12         echo $viewer->render("products_index.php", [
6a2226 13             "products"=> $products
F 14         ]);
026ec0 15     }
2e7bc3 16
a93a2f 17     public function show(string $id) {
8fdeaa 18         $viewer = new Viewer;
F 19         echo $viewer->render("Products/show.php", [
20             "id"=> $id
21         ]);
2e7bc3 22     }
1f822b 23
F 24     public function showPage(string $title, string $id, string $page) {
1e5093 25         echo $title, " ", $id, " ", $page;
1f822b 26     }
026ec0 27 }