|
|
@@ -5,19 +5,27 @@ use Routes\RouteCollection as RouteCollection;
|
|
|
|
|
|
//Menu itens
|
|
|
RouteCollection::get('*', function() {
|
|
|
-
|
|
|
- Output::headAdd('/', 'Dashboard');
|
|
|
- // Output::addMenu('/', 'Dashboard', "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link']);
|
|
|
- Output::addSubMenu('dashboard', 'Dashboard', "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link']);
|
|
|
- Output::addOnSubMenu('dashboard', '/', 'Dashboard', "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link']);
|
|
|
- Output::addOnSubMenu('dashboard', '/teste', 'Test', "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link']);
|
|
|
-
|
|
|
+ Output::addMenu('/', 'Dashboard', "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link'], -10);
|
|
|
+ Output::addMenu('/dre', 'DRE', "<i class='fa fa-bar-chart'></i>", ['class' => 'nav-link'], -10);
|
|
|
}, -10)->doIgnore();
|
|
|
|
|
|
RouteCollection::onHttpError('404', function($code){
|
|
|
- Output::setView(404)->render();
|
|
|
+ http_response_code(404);
|
|
|
+ Output::setTemplate('NullTemplate');
|
|
|
+ Output::render('404');
|
|
|
});
|
|
|
|
|
|
-RouteCollection::add('get', '/', '\App\Core\Welcome\WelcomeController@welcome');//->middlewareIgnore('auth');
|
|
|
+RouteCollection::add('get', '/', '\App\Core\Welcome\WelcomeController@welcome');
|
|
|
RouteCollection::add('get', '/teste', '\App\Core\Welcome\WelcomeController@teste');
|
|
|
-//RouteCollection::add('get', '/welcome', 'WellcomeController@welcome');
|
|
|
+RouteCollection::add('get', '/dre', '\App\Core\Welcome\WelcomeController@dre');
|
|
|
+//Filters
|
|
|
+
|
|
|
+RouteCollection::addDefaultMiddleware('fillpost', function () {
|
|
|
+
|
|
|
+ if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'POST'){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ $_POST = array_merge( $_POST, (array) json_decode( file_get_contents('php://input')) );
|
|
|
+
|
|
|
+});
|