<?php

ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
define("ROOT", realpath(".."));
require ROOT . "/vendor/autoload.php";
// LAYOUT HEADER
include ROOT . "/pages/layout/header.phtml";
// CONFIGURAR DEPENDENCY INJECTION
use SON\DI\DependencyInjection;
DependencyInjection::set("form-populate-empty", function () {
    return new \SON\Formulario\Item\Validate\EmptyValidate();
});
DependencyInjection::set("form-populate-min", function () {
    return new \SON\Formulario\Item\Validate\MinValidate();
});
DependencyInjection::set("form-populate-numeric", function () {
    return new \SON\Formulario\Item\Validate\NumericValidate();
});
///////////////////////////
// CONFIGURAÇÃO DE ROTAS //
///////////////////////////
// ROTAS
$rotas = ["^\\/formulario" => "Formulario:index", "^\\/fieldset" => "Fieldset:index", "^\\/populate" => "Populate:index"];
// PEGAR URI
$route = new \SON\Http\Router\Route();
$route->setRoutes($rotas);
$route->loadRoute($route->getPath());
// LAYOUT FOOTER
include ROOT . "/pages/layout/footer.phtml";