You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GeekQu_sspanel/app/Services/Slim.php

40 lines
742 B
PHTML

9 years ago
<?php
namespace App\Services;
use Slim\App;
use Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware;
/***
* The slim documents: http://www.slimframework.com/docs/objects/router.html
*/
class Slim
{
public $app;
public function newApp()
{
// config
$debug = false;
if (defined('DEBUG')) {
9 years ago
$debug = true;
}
// Make a Slim App
$app = new App([
'settings' => [
8 years ago
'debug' => $debug,
9 years ago
'whoops.editor' => 'sublime',
'displayErrorDetails' => $debug
]
]);
$app->add(new WhoopsMiddleware());
9 years ago
$this->app = $app;
}
public function run()
{
$this->app->run();
}
}