marcoazn89/slim-booboo

Booboo's integration for Slim3.0 framework

dev-master 2016-09-08 17:17 UTC

This package is not auto-updated.

Last update: 2024-04-27 15:52:57 UTC


README

BooBoo's integration for Slim3.0 framework

Install via Composer

composer require marcoazn89/slim-booboo:dev-master

Set up

$app->add(new \SlimBooboo\Middleware());

Overwrite default templates

// configArray overwrites the default error templates. Example:
$configArray= [
	'html'	=>	'some/folder/html.php',
	'json'	=>	'some/folder/json.php'
];

$app->add(new \SlimBooboo\Middleware($configArray));

Example

require '../vendor/autoload.php';

$app = new \Slim\App();

$app->add(new \SlimBooboo\Middleware());

$app->get('/exception/', function($req, $res, $arg) {
	throw new Exception("Error Processing Request", 1);
});

$app->get('/error/', function($req, $res, $arg) {
	$a->B();
});

$app->run();

BooBoo! BooBoo!