The <Simple> Framework.
A Simple PHP framework to help you make websites and web applications faster.
Simple Framework is kinda DIY framework. To keep everything light, Simple Framework is not packed with lots of features. It just gives you enough ground to build further. As simple as it can get, the Simple Framework is primarily developed to be compatible with Shared Hosting Providers. I have been working with clients who need their websites to be served on shared hosting. While I do love building with Laravel, it soon becomes an overkill as the project grows but resources don't. Simple Framework aims to give the same feel of Laravel but with quite less resource consumptions and overwhelming complexity. Simple Framework comes with Blade Templating Engine, Idiorm, Alto Router and very helpful
All you need is PHP 7.1+ and MySQL (optional).
- Install required packages with composer
$ composer create-project 0xcrypto/simple-framework
- Run the development server
$ php -S localhost:8000
http://localhost:8000and see Simple Framework in action.
Simple Framework uses MVC and you can tinker with everything. The
Simple directory contains the controllers and models. The views are outside in
views directory. These views are blade templates. Routes are written in
routes.php as an array which are splated into the Alto Router. Configurations are divided into two parts -
dotenv.php. Declarations in
config.php becomes global constants available in all over the application. On the other hand, declarations in
dotenv.php is accessible via config function. I know it should be the other way. I will fix it in next commit.
While primarily made for shared hosting, Simple Framework can be used in any kind of enviornment as far as PHP is installed. The process is same for all kind of hosting. Just upload the codebase to your hosting and change the
config.php with correct MySQL credentials.
It is okay if you upload vendor directory as well. If composer is available on your hosting environment, it is not recommended to upload vendor directory. Install packages using composer on the server.
$ composer install
It is recommended to keep everything out of
public_html directory except the
.htaccess. If you do this,
make sure you change the following lines in
<?php require_once "./vendor/autoload.php"; require_once "./helpers.php"; $configurations = require_once "./config.php"; $routes = require_once "./routes.php";
<?php require_once "./../simple/vendor/autoload.php"; require_once "./../simple/helpers.php"; $configurations = require_once "./../simple/config.php"; $routes = require_once "./../simple/routes.php";
.../simple is where Simple has been relocated.
If relocating the codebase is not possible, you can simply upload the code and it will work. Make sure you delete the following files.
- Blade Templating Engine - The templating engine used.
- Alto Router - Dependency Management
- Idiorm - The ORM used.
- dd - Reasonable var_dumps.
- composer - Dependency Management
Send pull requests to https://github.com/0xcrypto/simple.
- Vikrant Singh Chauhan - Developer & Maintainer - Follow on Twitter
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details