Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iqdevTranningProgram
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Адлан Шамавов
iqdevTranningProgram
Commits
c6ab1ce2
Commit
c6ab1ce2
authored
11 months ago
by
Адлан Шамавов
Browse files
Options
Downloads
Patches
Plain Diff
refactoring
parent
bd55bad2
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
Ptps controller 8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Controller/HomeController.php
+4
-3
4 additions, 3 deletions
src/Controller/HomeController.php
with
4 additions
and
3 deletions
src/Controller/HomeController.php
+
4
−
3
View file @
c6ab1ce2
...
@@ -7,6 +7,7 @@ use App\Validation\{ArrayValidation, DateValidation};
...
@@ -7,6 +7,7 @@ use App\Validation\{ArrayValidation, DateValidation};
use
DateTimeImmutable
;
use
DateTimeImmutable
;
use
Symfony\Bundle\FrameworkBundle\Controller\AbstractController
;
use
Symfony\Bundle\FrameworkBundle\Controller\AbstractController
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\Routing\Attribute\Route
;
use
Symfony\Component\Routing\Attribute\Route
;
...
@@ -87,7 +88,7 @@ class HomeController extends AbstractController
...
@@ -87,7 +88,7 @@ class HomeController extends AbstractController
return
$this
->
json
(
$fridays
);
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
public
function
func7
(
string
$startDate
,
string
$endDate
):
Response
{
{
if
(
DateValidation
::
validate
(
$startDate
)
&&
DateValidation
::
validate
(
$endDate
))
{
if
(
DateValidation
::
validate
(
$startDate
)
&&
DateValidation
::
validate
(
$endDate
))
{
...
@@ -104,8 +105,8 @@ class HomeController extends AbstractController
...
@@ -104,8 +105,8 @@ class HomeController extends AbstractController
return
new
Response
(
"Invalid date format"
);
return
new
Response
(
"Invalid date format"
);
}
}
#[Route('/{fileName}', name: '
home
')]
#[Route('/
func8/
{fileName}', name: '
func8
')]
public
function
home
(
string
$fileName
):
Response
// text.txt
public
function
func8
(
string
$fileName
):
Response
// text.txt
{
{
$filePath
=
$this
->
getParameter
(
'kernel.project_dir'
)
.
"/public/files/"
;
$filePath
=
$this
->
getParameter
(
'kernel.project_dir'
)
.
"/public/files/"
;
$text
=
$this
->
functions
->
readLogFile
(
$filePath
.
$fileName
);
$text
=
$this
->
functions
->
readLogFile
(
$filePath
.
$fileName
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment