You might not have noticed, but we did use parts of the MVC pattern before when we built our first block. A block consists of a controller located in a file named controller.php
and a view, by default named view.php.
There can also be more views in the templates
directory, which are called custom block templates in concrete5.
In concrete5, most pages are created from a page type. It's what you mostly do when you add a new page in the sitemap, but there are single pages like /login
and /dashboard
as well. Their functionality is usually unique, thus they are called single pages. A single page is what we're going to create when we output from an application in concrete5, which follows the MVC pattern.
Why MVC? What are the problems MVC tries to solve?
Different elements of the application have been included in a single file, the application logic, as well as the layout. There's no obvious structure in the application, making it hard to get a clear understanding of it...