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

Related tags

Frameworks Shady
Overview

Shady

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

Build Status Dependencies Status Latest Stable Version

What does it contain?

Available middlewares:

  • ApacheVirtualHostFix
  • UrlPrefix
  • UrlPostfix

ApacheVirtualHostFix

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

Example:

<?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

UrlPrefix

Allow to use a generic URL-prefix without having to define it every time:

Example 1: simple

<?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

Example 2: advanced using regex-pattern

<?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

UrlPostfix

todo

Allow to use a generic URL-postfix without having to define it every time:

Example:

<?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

How to install?

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

License

Shady is released under the MIT public license.

Bitdeli Badge

You might also like...
Plates Template Integration for Slim micro framework 3

Plates Template Integration for Slim micro framework 3 Render your Slim 3 application views using Plates template engine. Install Via Composer $ compo

Juliangut Slim Framework Doctrine handler middleware

Juliangut Slim Framework Doctrine handler middleware Doctrine handler middleware for Slim Framework. Slim3 version Doctrine integration service for Sl

This Slim Framework middleware will compile LESS CSS files on-the-fly using the Assetic library

This Slim Framework middleware will compile LESS CSS files on-the-fly using the Assetic library. It supports minification and caching, also via Asseti

Strict PSR-7 implementation used by the Slim Framework

Strict PSR-7 implementation used by the Slim Framework, but you may use it separately with any framework compatible with the PSR-7 standard.

Slim Framework custom views

Slim Views This repository contains custom View classes for the template frameworks listed below. You can use any of these custom View classes by eith

Access control middleware for Slim framework

Slim Access Access control middleware for Slim framework. Supported formats IPv4 and IPv6 addresses CIDR notation all keyword Installation composer re

Redis cache middleware for Slim framework

RedisCache Redis cache middleware for Slim framework. Installation composer require abouvier/slim-redis-cache Usage Cache every successful HTTP respo

Slim Framework using Jade for templates

Welcome to Slim-Jade What? This is a boilerplate. It's the Slim Framework with jade.php to render views Why? I like the Sinatra style MVC and love Jad

The Slim PHP micro framework paired with Laravel's Illuminate Database toolkit.

Slim & Eloquent The Slim PHP micro framework paired with Laravel's Illuminate Database toolkit. Getting started # Download composer curl -s https://ge

Owner
Jan-Age Laroo
Jan-Age Laroo
Here comes some changes of ci framework,with db seperated and the php connection pool

codeigniter-phpcp Here comes some changes of ci framework,include db seperated and the php connection pool ... environment seperate As the ci defines

null 11 Aug 25, 2022
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Slim Framework Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. Installation It's recommended

Slim Framework 11.5k Jan 4, 2023
Slim Framework - Prerequisite Checker

Slim Framework - Server Configuration Checker Upload the file check.php to your webserver Browse to the file: https://example.com/check.php Check the

Daniel Opitz 6 Aug 30, 2022
REST APIs using Slim framework. Implemented all CRUD operations on the MySql database

PHP REST API using slim framework and CRUD operations ?? Hi there, this is a simple REST API built using the Slim framework. And this is for the folks

Hanoak 2 Jun 1, 2022
A Slim PHP MVC framework built just for fun!

Aura Framework A Slim PHP MVC framework built just for fun! en: Note: This repository only contains the core code of the Aura framework. If you want t

Murilo Magalhães Barreto 2 Dec 16, 2021
Slim Framework skeleton application with MVC Schema

Slim Framework skeleton application with MVC Schema

JingwenTian 9 Apr 29, 2021
This repository contains a library of optional middleware for your Slim Framework application

Slim Framework Middleware This repository contains a library of optional middleware for your Slim Framework application. How to Install Update your co

Slim Framework 47 Nov 7, 2022
A curated list of awesome tutorials and other resources for the Slim micro framework

Awesome Slim A curated list of awesome tutorials and other resources for the Slim micro framework Table of Contents Essentials Tutorials Packages and

Sawyer Charles 466 Dec 8, 2022
Slim Framework 3 Skeleton Application + PagSeguro Lib

Slim Framework 3 Skeleton Application + PagSeguro Lib Aplicação simples para geração do Token para pagamentos no PagSeguro (método transparente) e env

Raí Siqueira 1 Feb 26, 2018
My personal blog developed on the Slim Framework

nesbot.com I am making the source code of my personal site available publicly in case it helps anybody. It's developed using the Slim Framework. I am

Brian Nesbitt 56 Sep 14, 2022