gestione views utilizzando variabile globale _GET[] (parte 16)
2 files modified
1 files deleted
| | |
| | | |
| | | require "src/controllers/products.php"; |
| | | $controller = new Products; |
| | | $controller->index(); |
| | | $action = $_GET["action"]; |
| | | |
| | | |
| | | if($action === "index") { |
| | | $controller->index(); |
| | | }elseif($action === "show") { |
| | | $controller->show(); |
| | | } |
| | | |
| | |
| | | |
| | | 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"; |