corso https://vola.udemy.com/course/php-mvc-from-scratch/learn/lecture/40931984#overview
filippo.bertilotti
2024-05-06 7bc6e3058c600c716c0d427208b201eecdbd70ca
gestione views utilizzando variabile globale _GET[] (parte 16)
2 files modified
1 files deleted
19 ■■■■■ changed files
index.php 10 ●●●●● patch | view | raw | blame | history
show.php 5 ●●●●● patch | view | raw | blame | history
src/controllers/products.php 4 ●●●● patch | view | raw | blame | history
index.php
@@ -2,4 +2,12 @@
require "src/controllers/products.php";
$controller = new Products;
$controller->index();
$action = $_GET["action"];
if($action === "index") {
    $controller->index();
}elseif($action === "show") {
    $controller->show();
}
show.php
File was deleted
src/controllers/products.php
@@ -2,9 +2,9 @@
class Products {
    public function index() {
        require "model.php";
        require "src/models/product.php";
    
        $model = new Model;
        $model = new Product;
        $products = $model->getData();
        require "views/products_index.php";