In the previous chapter, we have created a model and a controller, where the controller Contacts
class instantiates the model Contact
class. We successfully used a namespace
, a use
statement, a method, an access modifier, an object, and a class. We have witnessed the power of a framework in the previous chapter.
In this chapter, we will be building an MVC framework from scratch. A framework is really just a way to organize the code and structure it. Starting from an empty directory, we will build an entire working framework as a starting point for more complex applications.
Note
In the previous chapter, we retrieved data from an array. In this lesson, we will retrieve it from the database.
By the end of this chapter, you will be able to:
Build a basic PHP MVC framework
Implement the OOP concepts covered in the previous chapters
Identify how to route a controller to a specified URI
Interact with the database with PHP Data Objects (PDO)
Work with HTML to build and...