To use the MVC pattern/layout structure, does it basicly require everything to be loaded through 1 file, like your index file?
To use the MVC pattern/layout structure, does it basicly require everything to be loaded
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. The MVC pattern only dictates a separation of concerns regarding event/request handling, data modelling and user interface. The way this is implemented is not specified.
Many (all?) of the current PHP frameworks I am aware of do use a single entry point (index.php) and route from there. This often makes use of the “Front Controller” pattern.
The other method (using a separate PHP file per page) is known as the Page Controller pattern. It has the advantage of being much simpler, but loses the application wide control afforded by the front controller and may be prone to code duplication.