2020-02-27 19:09:54 -03:00
|
|
|
<?php
|
|
|
|
namespace ProVM\NotariaRaby\Common\Controller\Web;
|
|
|
|
|
|
|
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
|
|
use Psr\Http\Message\ResponseInterface as Response;
|
|
|
|
use Slim\Views\Blade as View;
|
2020-04-22 22:27:30 -04:00
|
|
|
use Carbon\Carbon;
|
2020-03-22 17:25:11 -03:00
|
|
|
use ProVM\Common\Service\Filemanager;
|
2020-02-27 19:09:54 -03:00
|
|
|
|
|
|
|
class Notaria {
|
2020-03-22 17:25:11 -03:00
|
|
|
public function __invoke(Request $request, Response $response, View $view, Filemanager $filemanager): Response {
|
|
|
|
$filename = 'equipos.yml';
|
|
|
|
$equipos = $filemanager->folder('data')->load($filename);
|
2020-03-27 02:59:53 -03:00
|
|
|
$filename = 'transparencia.yml';
|
|
|
|
$transparencia = $filemanager->folder('data')->load($filename);
|
2020-04-22 22:27:30 -04:00
|
|
|
$months = (object) ['full' => [], 'short' => []];
|
|
|
|
$m = Carbon::createFromDate(0, 1, 1);
|
|
|
|
for ($i = 0; $i < 12; $i ++) {
|
|
|
|
$months->full []= ucwords($m->copy()->addMonths($i)->locale('es_ES')->isoFormat('MMMM'));
|
|
|
|
$months->short []= ucwords($m->copy()->addMonths($i)->locale('es_ES')->isoFormat('MMM'));
|
|
|
|
}
|
|
|
|
return $view->render($response, 'notaria', compact('equipos', 'transparencia', 'months'));
|
2020-02-27 19:09:54 -03:00
|
|
|
}
|
|
|
|
}
|