The **Front Controller** is a pattern that centralizes the handling of all requests coming into a web application through a single object (usually a Servlet or an `index.php` class).
Instead of having each HTML or PHP page handle its own security and routing logic, the Front Controller receives the request, performs common tasks (authentication, logging, internationalization), and then delegates the execution to the specific command or controller.
# Advantages of Centralizing
-
router
Dynamic Routing
Allows changing the URL structure without moving physical files.
-
security
Central Security
A single place to check if the user has permissions.