- Clone or download the project.
- IMPORTANT! Change the directory name to your project name in the .htaccess file and change the format from .htaccess.txt to .htaccess (delete the ".txt")
- IMPORTANT! Set up your database and change the BASE_URL to yours in the config.php file.
- Create a new Controller first into the controllers folder. You have to use the _controller.php tag always. It won't work without it. Example: test_controller.php
- Copy the other controller code and change the class name to your new controller name
- Create a new View in the views folder on the same name as the new Controller. Use the _view.php tag in the end. Add some text into it like "Hello World"
- Change the $viewPath in the Controller to your new view's path
- Add a new route in the route.php. Example: '/mvc/test' => 'test_controller.php'
- Done. Let's try it out!
coming soon..
coming soon..
coming soon..
mvc/
├── app/
│ └── controllers/
│ └── about_controller.php
│ └── contact_controller.php
│ └── home_controller.php
│ └── javascript/
│ └── test.js
│ └── models/
│ └── test_model.php
│ └── views/
│ └── about_view.php
│ └── contact_view.php
│ └── footer_view.php
│ └── header_view.php
│ └── home_view.php
├── public/
│ └── css/
│ └── style.css
│ └── img/
│ └── production_images/
├── system/
│ └── config.php
│ └── database.php
├── index.php
├── init.php
├── route.php
└── .htaccess
-
app: Contains the main application files.
- controllers: Controllers for handling application logic.
- javascript: JavaScript files.
- models: Model classes for interacting with the database.
- views: View templates.
-
public: Publicly accessible files.
- css: Cascading Style Sheets.
- img: Image files.
- production_images: Images used in production.
-
system: System-level configuration files.
- config.php: Configuration settings.
- database.php: Database configuration.
-
index.php: Main entry point for the application.
-
init.php: Initialization script.
-
route.php: Routing configuration.
-
.htaccess: Apache server configuration.