ricardoper / slim3-skeleton

Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, Logger, VarDumper, Environment Variables And A Folder Structure With Sense
MIT License
45 stars 7 forks source link

PHP Slim Framework v3.5 Skeleton

Use this skeleton application to quickly setup and start working on a new Slim Framework v3.5 application.

NOTE: If you want a similar skeleton for version 4, go to: (https://github.com/ricardoper/slim4-twig-skeleton).

This skeleton application was built for Composer. This makes setting up a new Slim Framework v3.5 application quick and easy.

How to install this skeleton

Run this command from the directory in which you want to install your new Slim Framework v3.5 Skeleton.

composer create-project ricardoper/slim3-skeleton [my-app-name]

Replace [my-app-name] with the desired directory name for your new application. You'll want to:

Most relevant skeleton folders

Controllers methods

Middleware methods

Helpers methods

Middlewares

You can add as many middlewares as you want in a clean way (/app/Middlewares).

After add your middleware, you can enable or disable it in config/middlewares.php configuration file.

Routes

You can add as many routes files as you want (/app/Routes), but you need to enable these files in /apps/Routes/app.php file.

Services

You can add as many services as you want in a clean way (/app/Services).

After add your service, you can enable or disable it in config/services.php configuration file.

Configurations

You can add as many configurations files as you want (/config), but you need to enable these files in /config/app.php file.

Twig Globals

flash : To get Flash Messages

Demo pages

Try the skeleton demo pages.

Welcome page:

http(s)://virtualhost.int/

Hello user:

http(s)://virtualhost.int/hello/[name]

NOTE: Replace [name] with the desired User name

--

Enjoy the simplicity :oP