This is a minimal PHP framework that provides a basic understanding of the Model-View-Controller (MVC) architecture. It is designed to help you grasp the fundamental concepts of building web applications using this popular architectural pattern.
- Render view
- Route to call controller function
- Middleware
- Route with callback function
- Shared data from middleware
- Sanitize inputs
- Define fillables for data input
- Table builder, to make sure database conformity
- More to be added...
-
MVC Architecture: The framework follows the Model-View-Controller architectural pattern, which separates application logic, data, and presentation.
-
Routing: The framework includes a simple routing mechanism to map URLs to controller actions.
-
Controllers: Controllers handle user requests, process data, and interact with models and views.
-
Models: Models represent the data and business logic of the application.
-
Views: Views are responsible for presenting data to users in a user-friendly format.
- PHP (version 7.2 or higher)
- Clone the repository:
git clone https://github.com/ksyang1121/framework.git
- You may need to set up Apache server and re-configure rewrite rules
- Start Apache server, go to
localhost/framework
to view the result.
The framework does not require any specific configuration. However, you can customize the routing rules in the api.php
file to add new routes and map them to controller actions.
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as you see fit.