1
slim3 내 샘플 FastRoute에서이 FastRoute "정규식"와경기에 http | https를 fasteRoute와 여기 Slim3
$app->get('/api/search/[{domaine}[/{notused:.+}]]', function ($request, $response, $args) {
return $this->renderer->render($response, 'index.phtml', $args);
});
([{도멘은}/{NOTUSED : +.}]]), I가 일치 :
/api/search/sample.com
/api/search/sample.com/test
/api/search/
$ args [ 'domaine'] return "sample.com".
/api/search/http://sample.com
/api/search/https://sample.com
이 작품처럼 새로운 경로를 추가 :
$app->get('/api/search/http://[{domaine}[/{notused:.+}]]' ...
$app->get('/api/search/https://[{domaine}[/{notused:.+}]]' ...
을하지만 그것은 단지 하나의 라인을 가지고하는 것이 좋습니다
하지만 나도이 일치하도록합니다.
아이디어가 있으십니까?
감사합니다. 나를 위해 그것은 작동하지 않습니다. 그러나 나는 그 변론을 유지합니다 – trucky
왜 당신을 위해 작동하지 않습니다? –