2017 © Pedro Peláez
 

library shady

A set of shady Slim Framework middlewares that can solve some annoyances...

image

slim/shady

A set of shady Slim Framework middlewares that can solve some annoyances...

  • Monday, April 14, 2014
  • by laroo
  • Repository
  • 4 Watchers
  • 7 Stars
  • 654 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Shady

A set of shady Slim Framework middlewares that can solve some annoyances..., (*1)

Build Status Dependencies Status Latest Stable Version, (*2)

What does it contain?

Available middlewares: - ApacheVirtualHostFix - UrlPrefix - UrlPostfix, (*3)

ApacheVirtualHostFix

Fixes the resolving of URL's when using Apache VirtualHost in combination with VirtualDocumentRoot: 'VirtualDocumentRoot /www/hosts/%0/www', (*4)

Example:, (*5)

<?php
$oApp = new \Slim\Slim();
$oApp->add(new \Slim\Shady\Middleware\ApacheVirtualHostFix());
$oApp->get('/my/name/is', function () { echo "Slim Shady!"; });
$oApp->run();

Callable URL: /my/name/is, (*6)

UrlPrefix

Allow to use a generic URL-prefix without having to define it every time:, (*7)

Example 1: simple, (*8)

<?php
$oApp = new \Slim\Slim();
$oApp->add(new \Slim\Shady\Middleware\UrlPrefix('/api'));
$oApp->get('/login', function () { echo "Slim Shady!"; });
$oApp->run();

Callable URL: /api/login, (*9)

Example 2: advanced using regex-pattern, (*10)

<?php
 $oApp = new \Slim\Slim();
$oRoutePrefix = new \Slim\Shady\Middleware\UrlPrefix('/api/:version');
$oRoutePrefix->setConditions(array(
    'version' => 'v[0-9]+'
));
$oApp->add($oRoutePrefix);
$oApp->get('/login', function () use ($oApp) {
    echo "API-version: ".$oApp->urlprefix_params['version'];
});
$oApp->run();

Callable URL: /api/v2/login, (*11)

UrlPostfix

todo, (*12)

Allow to use a generic URL-postfix without having to define it every time:, (*13)

Example:, (*14)

<?php
$oApp = new \Slim\Slim();
$oApp->add(new \Slim\Shady\Middleware\UrlPostfix('.json'));
$oApp->get('/login', function () { echo "Slim Shady!"; });
$oApp->run();

Callable URL: /api/v2/login.json, (*15)

How to install?

Use Composer to install Shady and it's dependencies (Slim + PHP), (*16)

License

Shady is released under the MIT public license., (*17)

Bitdeli Badge, (*18)

The Versions

14/04 2014

dev-master

9999999-dev http://github.com/laroo/Shady

A set of shady Slim Framework middlewares that can solve some annoyances...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jan-Age Laroo

api middleware extension rest slim microframework router

14/04 2014

1.0.2

1.0.2.0 http://github.com/laroo/Shady

A set of shady Slim Framework middlewares that can solve some annoyances...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jan-Age Laroo

api middleware extension rest slim microframework router

07/02 2014

1.0.1

1.0.1.0 http://github.com/laroo/Shady

A set of shady Slim Framework middlewares that can solve some annoyances...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jan-Age Laroo

api middleware extension rest slim microframework router

22/08 2013

v2.0.0alpha2

2.0.0.0-alpha2 http://github.com/laroo/Shady

A set of shady Slim Framework middlewares that can solve some annoyances...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jan-Age Laroo

extension rest slim microframework router

22/08 2013

v2.0.0alpha1

2.0.0.0-alpha1 http://github.com/laroo/Shady

A set of shady Slim Framework middlewares that can solve some annoyances...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jan-Age Laroo

extension rest slim microframework router

17/07 2013

1.0.0

1.0.0.0 http://github.com/laroo/Shady

A shady Slim-Framework extend that solves some annoying 'features'...

  Sources   Download

MIT

The Requires

 

by Jan-Age Laroo

extension rest slim microframework router