2017 © Pedro Peláez
 

library slim3-skeleton

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

image

ricardoper/slim3-skeleton

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  • Tuesday, September 13, 2016
  • by ricardoper
  • Repository
  • 4 Watchers
  • 24 Stars
  • 170 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 10 Versions
  • 10 % Grown

The README.md

PHP Slim Framework v3.5 Skeleton

Use this skeleton application to quickly setup and start working on a new Slim Framework v3.5 application., (*1)

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

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

  • PSR-2
  • PSR-4
  • PHP 5.5
  • Namespaced, (*4)

  • Helpers, (*5)

  • Services
  • Twig Views
  • Flash Messages
  • Symfony VarDumper
  • Logging with Monolog
  • Folders structure with sense
  • Environment variables with Dotenv

How to install this skeleton

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

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: - Point your virtual host document root to your new application's public/ directory. - Ensure storage/ is web writeable., (*7)

Most relevant skeleton folders

  • /app : Application code (App Namespace)
    • ./Controllers : Add your controllers here
    • ./Middlewares : Add your middlewares here
    • ./Routes : Add your routes here
    • ./Services : Add your services here
    • ./Views : Add your Twig views here
  • /config : Add/modify your configurations here
  • /public : Add your assets files here

Controllers methods

  • getContainer() : Returns the Slim App container
  • getService(string $service) : Returns service from container by name
  • getRequest() : Returns HTTP Request
  • getResponse() : Returns HTTP Response
  • getView() : Returns Twig View
  • render(string $template, array $data) : Renders Twig page stored in Views folder

Middleware methods

  • getContainer() : Returns the Slim App container
  • getService(string $service) : Returns service from container by name

Helpers methods

  • d() : Symfony VarDumper and continue
  • dd() : Symfony VarDumper and die
  • env(string $variable, string $default) : Return environment variables with
  • base_path() : Returns base path location
  • app_path() : Returns app path location
  • config_path() : Returns config path location
  • public_path() : Returns public path location
  • storage_path() : Returns storage path location

Middlewares

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

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

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., (*10)

Services

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

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

Configurations

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

Twig Globals

flash : To get Flash Messages, (*14)

Demo pages

Try the skeleton demo pages., (*15)

Welcome page:

http(s)://virtualhost.int/, (*16)

Hello user:

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

NOTE: Replace [name] with the desired User name, (*18)

--, (*19)

Enjoy the simplicity :oP

The Versions

13/09 2016

dev-master

9999999-dev https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

13/09 2016

v1.3.1

1.3.1.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

13/09 2016

1.3

1.3.0.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

13/09 2016

v1.2.2

1.2.2.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

13/09 2016

v1.2.1

1.2.1.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

13/09 2016

v1.2

1.2.0.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

12/09 2016

v1.1.2

1.1.2.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

12/09 2016

v1.1.1

1.1.1.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

12/09 2016

v1.1

1.1.0.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper

12/09 2016

v1.0

1.0.0.0 https://github.com/ricardoper

PHP Slim Framework v3.5 Skeleton With Twig Views, Flash Messages, VarDumper And A Good Folder Organization

  Sources   Download

MIT

The Requires

 

framework twig php skeleton slim flash vardumper