<?php $router = new myRouter(false); $router->addMiddlewaresForEveryRoute(['IsLoginValidator']); $router->removeExtraSlashes(true); $router->add('/', 'Movies::index'); $router->add('/movies/page/{page:[0-9]+}', 'Movies::index')->setName('index.page'); $router->add('/movies', 'Movies::index')->setName('movies.index'); $router->add('/movies/{movie:[0-9]+}', 'Movies::show')->setName('movies.show'); $router->addx('/movies/{movie:[0-9]+}/edit', 'Movies::edit', ['MovieValidator'])->setName('movies.edit'); $router->add('/movies/{movie:[0-9]+}/delete', 'Movies::delete')->setName('movies.delete'); $router->add('/movies/{movie:[0-9]+}/becomeSerial', 'Movies::becomeSerial')->setName('movies.becomeSerial'); $router->add('/movies/search/{search:[^/]+}', 'Movies::search')->setName('movies.search'); $router->add('/movies/search/{search:[^/]+}/page/{page:[0-9]+}', 'Movies::search')->setName('movies.search.page'); //更新episodes的信息,从kat网站抓取数据来更新本季数据, $router->add('/movies/{movie:[0-9]+}/updateEpisodesInfo', 'Movies::updateEpisodesInfo')->setName('movies.updateEpisodesInfo'); //链接相关的操作 $router->add('/movies/{movie:[0-9]+}/links', 'Movies::showLinks')->setName('movies.movieLinks'); $router->add('/movies/{movie:[0-9]+}/links/{link:[0-9]+}/delete', 'Movies::deleteLinks')->setName('movies.deleteLink'); $router->addx('/movies/{movie:[0-9]+}/addlink', 'Movies::addLink', ['LinkValidator'])->setName('movies.addLink'); //评论相关的操作 $router->add('/movies/comments', 'Movies::showCommentList')->setName('movies.showCommentLis'); $router->addx('/movies/{movie:[0-9]+}/addComment', 'Movies::addComment', ['CommentValidator'])->setName('movies.addComment'); $router->addx('/movies/{movie:[0-9]+}/comments/{comment:[0-9]+}/edit', 'Movies::editComment', ['CommentValidator', 'HasAuthorityValidator:comment'])->setName('movies.editComment'); $router->addx('/movies/{movie:[0-9]+}/comments/{comment:[0-9]+}/delete', 'Movies::deleteComment', ['HasAuthorityValidator:comment'])->setName('movies.deleteComment'); //收藏相关的操作 $router->add('/movies/{movie:[0-9]+}/addFavorite', 'Movies::addFavorite')->setName('movies.addFavorite'); $router->add('/movies/{movie:[0-9]+}/deleteFavorite', 'Movies::deleteFavorite')->setName('movies.deleteFavorite'); //与电视剧的标签相关的操作 $router->addx('/movies/{movie:[0-9]+}/addTag', 'Movies::addTag', ['TagValidator'])->setName('movies.addTag'); $router->add('/movies/{movie:[0-9]+}/tags', 'Movies::showTags')->setName('movies.showTags');
<?php $router = new myRouter(false); $router->addMiddlewaresForEveryRoute(['IsLoginValidator']); $router->removeExtraSlashes(true); $router->add('/page/{page:[0-9]+}', 'index::index')->setName('index'); $router->add('/', 'index::index')->setName('home'); $router->add('/search/{search:[^/]+}', 'standards::search')->setName('standards.search.index'); $router->add('/search/{search:[^/]+}/page/{page:[0-9]+}', 'standards::search')->setName('standards.search'); $router->add('/search/{search:[^/]+}/{item:[0-9]+}', 'standards::showSearchItem')->setName('standards.showSearchItem'); $router->addx('/standards/add', 'standards::add', ['standardRules'])->setName('standards.add'); $router->add('/standards/addDoD', 'standards::addDoD')->setName('standards.addDoD'); $router->add('/standards/addWebData/{type}/{source_id}', 'standards::getWebData')->setName('standards.getWebData'); $router->add('/standards/archive/{month:[-0-9]+}', 'standards::archive')->setName('standards.archive'); $router->add('/standards/archive/{month:[-0-9]+}/page/{page:[0-9]+}', 'standards::archive')->setName('standards.archive.page'); $router->add('/standards/{file:[0-9]+}', 'standards::show')->setName('standards.show'); $router->addx('/standards/{file:[0-9]+}/edit', 'standards::edit', ['standardRules'])->setName('standards.edit'); $router->add('/standards/{file:[0-9]+}/delete', 'standards::delete')->setName('standards.delete'); $router->addx('/standards/{file:[0-9]+}/addComment', 'standards::addComment', ['commentRules'])->setName('standards.addComment'); $router->addx('/standards/{file:[0-9]+}/comments/{comment:[0-9]+}/edit', 'standards::editComment', ['commentRules'])->setName('standards.editComment'); $router->add('/standards/{file:[0-9]+}/comments/{comment:[0-9]+}/delete', 'standards::deleteComment')->setName('standards.deleteComment'); $router->add('/standards/{file:[0-9]+}/Attachments', 'standards::showAttachments')->setName('standards.showAttachments'); $router->add('/standards/{file:[0-9]+}/addAttachment', 'standards::addAttachment')->setName('standards.addAttachment'); $router->add('/standards/{file:[0-9]+}/Attachments/{attachment:[0-9]+}/edit', 'standards::editAttachment')->setName('standards.editAttachment'); $router->add('/standards/{file:[0-9]+}/Attachments/{attachment:[0-9]+}/delete', 'standards::deleteAttachment')->setName('standards.deleteAttachment'); $router->add('/standards/{file:[0-9]+}/Attachments/{attachment:[0-9]+}/download', 'standards::downloadSingleAttachment')->setName('standards.downloadSingleAttachment'); $router->add('/standards/{file:[0-9]+}/addTag', 'standards::addTag')->setName('standards.addTag'); $router->add('/standards/{file:[0-9]+}/deleteTag/{taggable:[0-9]+}', 'standards::deleteTag')->setName('standards.deleteTag'); $router->add('/standards/{file:[0-9]+}/tags', 'standards::showTags')->setName('standards.showTags'); $router->add('/standards/addTag2List', 'standards::addTag2List')->setName('standards.list.addTag'); //标准的链接相关的操作