To run a controller function method on a specific route path.
Setting a route with the request method type of get.
<?php
use core\http\Route;
new Route(['GET' => '/path'], ['Controller' => 'method']);
Setting a route with the request method type of post.
<?php
use core\http\Route;
new Route(['POST' => '/path'], ['Controller' => 'method']);
Controllers inside subfolders should be devided with backslashes.
<?php
use core\http\Route;
new Route(['GET' => '/path'], ['subfolder\Controller' => 'method']);
Any value will match inside the url on the same string position as the setted route key in the route path. When the route key is set, this value will be passed inside the controller method as an argument as an associative array. The key value is the same as the setted route key.
<?php
use core\http\Route;
new Route(['GET' => '/path/[routeKey]'], ['Controller' => 'method']);