Now I have this code somewhere in the core
class:
$routes = explode('/', $_SERVER['REQUEST_URI']); if ( !empty($routes[1]) ) { $controller_name = $routes[1]; } elseif ( !empty($routes[2]) ) { $action_name = $routes[2]; }
In .htaccess
:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L]
Then start the controller with the specified name and the method actiion_name
. Actually, the question is: how are links from more than two parts processed?
For example /event/today/morning/wakeup
.
How is the controller call issued in this case? I'm learning, so I will be grateful if someone explains what's what.