marcoazn89/slim-booboo

Booboo对Slim3.0框架的集成

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

This package is not auto-updated.

Last update: 2024-09-28 18:16:10 UTC


README

BooBoo对Slim3.0框架的集成

通过Composer安装

composer require marcoazn89/slim-booboo:dev-master

设置

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

覆盖默认模板

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

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

示例

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!