Skip to content

Commit

Permalink
Fix routing
Browse files Browse the repository at this point in the history
  • Loading branch information
endroid committed Nov 7, 2023
1 parent 6aabf61 commit 56f405f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
5 changes: 2 additions & 3 deletions .install/symfony/config/routes/endroid_soccer_calendar.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
endroid_soccer_calendar:
resource: "@EndroidSoccerCalendarBundle/Controller/"
type: annotation
endroid_data_sanitize:
resource: "@EndroidSoccerCalendarBundle/Resources/config/routes.yaml"
prefix: /soccer-calendar
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"php": "^8.1",
"endroid/installer": "^1.2.2",
"endroid/soccer-calendar": "^2.2",
"symfony/dependency-injection": "^5.4||^6.0",
"symfony/http-foundation": "^5.4||^6.0",
"symfony/twig-bundle": "^5.4||^6.0"
"symfony/dependency-injection": "^5.4||^6.4||^7.0",
"symfony/http-foundation": "^5.4||^6.4||^7.0",
"symfony/twig-bundle": "^5.4||^6.4||^7.0"
},
"require-dev": {
"endroid/quality": "dev-master"
Expand Down
4 changes: 0 additions & 4 deletions src/Controller/TeamCalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Endroid\SoccerData\Loader\GameLoaderInterface;
use Endroid\SoccerData\Loader\TeamLoaderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

final class TeamCalendarController
{
Expand All @@ -23,9 +22,6 @@ public function __construct(
) {
}

/**
* @Route("/{competitionName}/team/{teamName}.ics", name="soccer_calendar_team")
*/
public function __invoke(string $competitionName, string $teamName): Response
{
$competition = $this->competitionLoader->loadByName($competitionName);
Expand Down
4 changes: 0 additions & 4 deletions src/Controller/TeamListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Endroid\SoccerData\Loader\CompetitionLoaderInterface;
use Endroid\SoccerData\Loader\TeamLoaderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Twig\Environment;

final class TeamListController
Expand All @@ -21,9 +20,6 @@ public function __construct(
) {
}

/**
* @Route("/", name="soccer_calendar_list")
*/
public function __invoke(): Response
{
$competitions = [];
Expand Down
7 changes: 7 additions & 0 deletions src/Resources/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
soccer_calendar_team_calendar:
path: /{competitionName}/team/{teamName}.ics
controller: Endroid\SoccerCalendarBundle\Controller\TeamCalendarController

soccer_calendar_team_list:
path: /
controller: Endroid\SoccerCalendarBundle\Controller\TeamListController
4 changes: 2 additions & 2 deletions src/Resources/views/team/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
{% for team in competition.teams %}

<tr>
<td><a href="{{ path('soccer_calendar_team', { competitionName: competition.name, teamName: team.name }) }}">{{ team.name }}</a></td>
<td width="20"><a href="{{ url('soccer_calendar_team', { competitionName: competition.name, teamName: team.name })|replace({'https://': 'webcal://'}) }}"><span class="glyphicon glyphicon-calendar"></span></a></td>
<td><a href="{{ path('soccer_calendar_team_calendar', { competitionName: competition.name, teamName: team.name }) }}">{{ team.name }}</a></td>
<td width="20"><a href="{{ url('soccer_calendar_team_calendar', { competitionName: competition.name, teamName: team.name })|replace({'https://': 'webcal://'}) }}"><span class="glyphicon glyphicon-calendar"></span></a></td>
</tr>

{% endfor %}
Expand Down

0 comments on commit 56f405f

Please sign in to comment.