Compare commits

..

No commits in common. "master" and "20241005.3" have entirely different histories.

View file

@ -2,18 +2,16 @@
namespace Misuzu; namespace Misuzu;
use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait}; use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait};
use Index\Urls\{UrlFormat,UrlRegistry,UrlSource}; use Index\Urls\{UrlFormat,UrlRegistry,UrlSource,UrlSourceTrait};
class LegacyRoutes implements RouteHandler, UrlSource { class LegacyRoutes implements RouteHandler, UrlSource {
use RouteHandlerTrait; use RouteHandlerTrait, UrlSourceTrait;
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>');