Files
oficial/app/resources/routes/03_proyectos.php
Juan Pablo Vial c7ee440e03 Listado de brokers
2025-03-06 20:34:43 -03:00

21 lines
775 B
PHP

<?php
use Incoviba\Controller\Proyectos;
$app->group('/proyectos', function($app) {
$folder = implode(DIRECTORY_SEPARATOR, [__DIR__, 'proyectos']);
if (file_exists($folder)) {
$files = new FilesystemIterator($folder);
foreach ($files as $file) {
if ($file->isDir()) {
continue;
}
include_once $file->getRealPath();
}
}
$app->get('/unidades[/]', [Proyectos::class, 'unidades']);
$app->get('[/]', Proyectos::class);
})->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class));
$app->group('/proyecto/{proyecto_id}', function($app) {
$app->get('[/]', [Proyectos::class, 'show']);
})->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class));