<?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');
?>