Compare commits

..

1 commit

Author SHA1 Message Date
fc6a899f16 Fixed some URLs not getting registered properly. 2024-10-05 15:28:56 +00:00

View file

@ -2,16 +2,18 @@
namespace Misuzu; namespace Misuzu;
use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait}; use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait};
use Index\Urls\{UrlFormat,UrlRegistry,UrlSource,UrlSourceTrait}; use Index\Urls\{UrlFormat,UrlRegistry,UrlSource};
class LegacyRoutes implements RouteHandler, UrlSource { class LegacyRoutes implements RouteHandler, UrlSource {
use RouteHandlerTrait, UrlSourceTrait; use RouteHandlerTrait;
public function __construct( public function __construct(
private UrlRegistry $urls private UrlRegistry $urls
) {} ) {}
public function registerUrls(UrlRegistry $urls): void { public function registerUrls(UrlRegistry $urls): void {
UrlFormat::register($urls, $this);
// eventually this should be handled by context classes // eventually this should be handled by context classes
$urls->register('search-index', '/search.php'); $urls->register('search-index', '/search.php');
$urls->register('search-query', '/search.php', ['q' => '<query>'], '<section>'); $urls->register('search-query', '/search.php', ['q' => '<query>'], '<section>');