1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| <?php
| namespace App\Controllers;
| use App\Models\Product;
| use Framework\Viewer;
| class Products {
| public function index() {
|
| $model = new Product;
| $products = $model->getData();
|
| $viewer = new Viewer;
| echo $viewer->render("products_index.php", [
| "products"=> $products
| ]);
| }
|
| public function show(string $id) {
| $viewer = new Viewer;
| echo $viewer->render("Products/show.php", [
| "id"=> $id
| ]);
| }
|
| public function showPage(string $title, string $id, string $page) {
| echo $title, " ", $id, " ", $page;
| }
| }
|
|