Skip to content

Commit

Permalink
URL
Browse files Browse the repository at this point in the history
  • Loading branch information
cevro committed Jul 5, 2024
1 parent c6dc987 commit f8fd533
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
12 changes: 3 additions & 9 deletions app/Modules/Fykos/DefaultModule/ResultsPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@
use App\Models\Downloader\FKSDBDownloader;
use Fykosak\FKSDBDownloaderCore\Requests\SeriesResultsRequest;

use Nette\Application\Attributes\Persistent;
use Tracy\Debugger;

class ResultsPresenter extends BasePresenter
{
#[Persistent]
public ?int $year;

/** @persistent */
public ?int $year = null;

private readonly FKSDBDownloader $downloader;

Expand All @@ -28,10 +24,8 @@ public function injectDownloader(FKSDBDownloader $downloader): void
*/
public function renderDefault(): void
{
Debugger::barDump($this->year);

$year = $this->year ?? self::CURRENT_YEAR;
$this->template->year = $year;
$this->template->results = $this->downloader->download(new SeriesResultsRequest(1, $year, 1));
$this->template->results = $this->downloader->download(new SeriesResultsRequest(1, $year));
}
}
31 changes: 14 additions & 17 deletions app/RouterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Nette\Application\Routers\RouteList;
use Nette\Routing\Route;
use Nette\Routing\Router;
use Tracy\Debugger;

class RouterFactory
{
Expand Down Expand Up @@ -182,18 +181,16 @@ public static function createFykosRouter(?array $domainList, array $routerMappin
$router = new RouteList();



Debugger::barDump($domainList);


$router->withModule('Default')->addRoute("//<domain>/results[/<year [0-9]{2}>]", [
$router->addRoute('//<domain>/<lang results|poradi>[/<year [0-9]{2}>]', [
'module' => 'Default',
'presenter' => 'Results',
'action' => 'default',
'lang' => 'cs'
// 'lang' => ['filterTable' => [
// 'poradi' => "cs",
// 'results' => "en",
// ]]
'year' => null,
'lang' => ['filterTable' => [
'poradi' => "cs",
'results' => "en",
]],
null => self::useTranslateFilter($domainList, [])
]);

$router->withModule('Default')
Expand All @@ -209,12 +206,12 @@ public static function createFykosRouter(?array $domainList, array $routerMappin
null => self::useTranslateFilter($domainList, $routerMapping['events']),
]);

// $router->withModule('Default')
// ->addRoute('//<domain>/<presenter>[/<action>]', [
// 'presenter' => 'Default',
// 'action' => 'default',
// null => self::useTranslateFilter($domainList, $routerMapping['default']),
// ]);
$router->withModule('Default')
->addRoute('//<domain>/<presenter>[/<action>]', [
'presenter' => 'Default',
'action' => 'default',
null => self::useTranslateFilter($domainList, $routerMapping['default']),
]);


return $router;
Expand Down

0 comments on commit f8fd533

Please sign in to comment.