Is it recommended to have a separate controller for each view in PHP MVC architecture?

In PHP MVC architecture, it is not necessary to have a separate controller for each view. Instead, it is common practice to have controllers that handle multiple views and their corresponding actions. This helps in keeping the codebase organized and avoids unnecessary duplication of code.

// Example of a single controller handling multiple views in PHP MVC architecture

class HomeController {
    public function index() {
        // Logic for displaying the home view
    }

    public function about() {
        // Logic for displaying the about view
    }

    public function contact() {
        // Logic for displaying the contact view
    }
}

// Usage
$controller = new HomeController();

// Displaying the home view
$controller->index();

// Displaying the about view
$controller->about();

// Displaying the contact view
$controller->contact();