. // }}} namespace Plugin\Media; use App\Core\Event; use App\Core\Modules\Module; use App\Core\Router\RouteLoader; class Media extends Module { /** * Map URLs to Controllers */ public function onAddRoute(RouteLoader $r) { // foreach (['' => 'attachment', // '/view' => 'attachment_view', // '/download' => 'attachment_download', // '/thumbnail' => 'attachment_thumbnail'] as $postfix => $action) { // foreach (['filehash' => '[A-Za-z0-9._-]{64}', // 'attachment' => '[0-9]+'] as $type => $match) { // $r->connect($action, "attachment/:{$type}{$postfix}", // ['action' => $action], // [$type => $match]); // } // } $r->connect('attachment', '/attachment/{filehash<[A-Za-z0-9._-]{64}>}', Controller\Attachment::class); return Event::next; } }