A PHP OOP web application skeleton that uses MVC architectural pattern to create a basic application that contains login and multi language systems and can be used in any web project.
- It was created to get rid of the trouble of creating a MVC script from scratch
Basic php skeleton of an MVC (model-view-controller) web application that you can use to build your application upon it or to understand the MVC pattern.
- MVC based application
- MYSQL database connection
- multi language
- login system
- session store and recovery
It's a normal MVC application so it consists of models/views/controllers
- First it runs the initiation script init.php
- The initiation script loads main scripts and confinguration files.
- Then a new app instance is created and the url is parsed in the App.php class
- In App.php class the requested language is set and the requested controller is loaded ex: home.php controller.
- A controller class instance is created and the requested method called
- The method calls the model method and in the model loading method we check for login Controller model
- If the user is loggedin it'll get the requested model, else it'll redirect to login
- The controller method then calls the view method and in the view loading method we load the language files and the page layout. Controller view
-
app: Application backend
- config: configuration files
- core: core scripts called in app initiation
- Helper: helper function such as common used and database functions
- languages: languages contain directories with language code
- controllers: application controllers
- models: application models
- views: application views
- init.php: initiation script that includes necessary scripts.
- .htaccess: htaccess file to prevent entering this area for users
- Just clone the repo and start building upon the provided skeleton
I'll be pleased to see contribution send a pull request, if you have any questio you can open an issue.