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) { |
F |
18 |
var_dump($id); |
2e7bc3
|
19 |
require "views/products_show.php"; |
F |
20 |
} |
1f822b
|
21 |
|
F |
22 |
public function showPage(string $title, string $id, string $page) { |
1e5093
|
23 |
echo $title, " ", $id, " ", $page; |
1f822b
|
24 |
} |
026ec0
|
25 |
} |