Base
This commit is contained in:
21
bootstrap/routes.php
Normal file
21
bootstrap/routes.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
use App\Contract\Route;
|
||||
use Stringy\Stringy;
|
||||
|
||||
/*
|
||||
* TODO: Language Changer
|
||||
* Route::add('GET', 'change_language', function() {
|
||||
\App\Contract\Session::set('App', 'lang', get('lang'));
|
||||
header('Location: .');
|
||||
});*/
|
||||
|
||||
$controllers = glob(config('locations.controllers') . '/*.php');
|
||||
foreach ($controllers as $controller) {
|
||||
$info = pathinfo($controller);
|
||||
$name = $info['filename'];
|
||||
$route = '' . Stringy::create($name)->underscored();
|
||||
Route::add(['GET', 'POST'], $route, $name);
|
||||
}
|
||||
|
||||
Route::add(['GET', 'POST'], 'buscar', 'Buscar');
|
||||
?>
|
Reference in New Issue
Block a user