dev-master
9999999-devA simple PHP MVC skeleton build on top of Slim
MIT
The Requires
by Siro Diaz
A simple PHP MVC skeleton build on top of Slim
A Slim 3 MVC skeleton. It uses PDO for the model layer and Twig for the view layer. Also it depends of hassankhan/config library for load config files and the symfony/console package for the Sglim command line tool. Sglim can be extended adding few neccesary packages because Sglim goal is keep simple the Slim configuration., (*1)
There are many Slim framework skeletons but i don't see neither that like me. So i have decided to build my own "MVC" skeleton for small/medium APIs and dynamic websites when you need speed and low complexity in your apps., (*2)
All you need to install Sglim is Composer. Run the following command., (*3)
``` bash $ composer create-project "sglim/sglim":"dev-master" app-name, (*4)
## Run the application Go into the public folder inside the project folder and then ``` bash $ cd app-name/public # run the server $ php -S 0.0.0.0:8000
Sglim uses different folders to organize your project based in other frameworks structure., (*5)
Sglim allows you many shortcuts to make things fast. Right now there are 3 main commands:, (*6)
Generate a new route file if the route doesn't exist., (*7)
``` bash $ php sglim make:route route-name, (*8)
**Generate a new model** ``` bash $ php sglim make:model model-name
Generate a new view HTML5 file, (*9)
bash
$ php sglim make:view view-name
, (*10)
Question 1: Can i use an ORM instead of PDO extension? Yes, you can. I tried using Eloquent(Lavel ORM) and i had to do minor changes in the index.php file. Only i had to add a charset option in the configuration file but it works properly. It is pretty simple and if you love ORMs you can mix Sglim with the ORM that you want., (*11)
Question 2: Why doesn't Sglim include all Slim package like Slim-Csrf? Because the Sglim idea is to keep it simple. But maybe in future commits i will set them to Sglim package, (*12)
You can contact with me through Twitter(@Siro_Diaz) or email me <siro_diaz@yahoo.com>, (*13)
A simple PHP MVC skeleton build on top of Slim
MIT