Português | English |
---|---|
project
https://github.com/ribafs/simplest-router
- https://github.com/Izamzawi/blog-php-mvc
- https://github.com/panique/mini3
- https://github.com/nikic/FastRoute
This little routing system works well with PHPOO applications with MVC
Capture the URL and split it into parts: controller, action and parameter
http://localhost/application/controller/action/param
Example
http://localhost/crud-mvc/product/edit/5
- Windows 10
- Laragon - PHP 8.1
- Linux Mint 21
- PHP 8.1
- Ubuntu
- 22.04 - PHP 8.1
- 20.04 - PHP 7.4
- 14.04 - PHP 5.5
- Namespace
- Require
- Fixed
- MySQL/MariaDb
- PostgreSQL
declare(strict_types = 1);
Nor is the syntax:
$this->controller->{$this->action}( ...$this->params);
- Module mod_rewrite from Apache
if ( ! class_exists('App\Controllers\ProductController')) die('Class not found!');
die(CLASS);
get_class($this);