A framework for web applications to implement the Model–View–Controller (MVC) architecture pattern.
Like most web MVC frameworks, cMVC has the following key components.
- Router - Directs web requests to application controllers and other code.
- Controllers - PHP classes triggered by the router to service web requests.
- Models - PHP classes with app-specific methods to interact with content.
- Views - Templates used by controllers to produce the application's output.
A typical cMVC web application is a package with the following files and subfolders.
- index.php - Uses router to direct web requests to application controllers and other code.
- config/ - Contains configuration files that define application settings and data.
- controllers/ - Contains PHP classes that extend controller, which are launched by the router.
- views/ - Contains views used by controllers to produce the web application's output.
- models/ - Contains models that add package-specific methods to content types.