I have a webpage that fetch product data from arrays and print all type of products like the example given below.
I want to use routing if it is useful for this case. i saw some example code like below:
class Controller {
public $model;
public function __construct()
{
$this->model = new Model();
}
public function invoke()
{
// show the requested products
$products = $this->model->getList($_GET['type']);
include 'view/viewlist.php';
}
}
I am learning custom MVC in php and finding the benefits of routing in this example.
How can I use routing for getting product list.