Skip to content
Snippets Groups Projects
Commit c6ab1ce2 authored by Адлан Шамавов's avatar Адлан Шамавов
Browse files

refactoring

parent bd55bad2
No related branches found
No related tags found
1 merge request!8Ptps controller 8
......@@ -7,6 +7,7 @@ use App\Validation\{ArrayValidation, DateValidation};
use DateTimeImmutable;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Attribute\Route;
......@@ -87,7 +88,7 @@ class HomeController extends AbstractController
return $this->json($fridays);
}
#[Route('/func7/{startDate}/{endDate}', name: 'home')] // 01-01-2024
#[Route('/func7/{startDate}/{endDate}', name: 'func7')] // 01-01-2024
public function func7(string $startDate, string $endDate): Response
{
if (DateValidation::validate($startDate) && DateValidation::validate($endDate)) {
......@@ -104,8 +105,8 @@ class HomeController extends AbstractController
return new Response("Invalid date format");
}
#[Route('/{fileName}', name: 'home')]
public function home(string $fileName): Response // text.txt
#[Route('/func8/{fileName}', name: 'func8')]
public function func8(string $fileName): Response // text.txt
{
$filePath = $this->getParameter('kernel.project_dir') . "/public/files/";
$text = $this->functions->readLogFile($filePath . $fileName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment