Slim 3 ルートで or-option を使用するにはどうすればよいですか?
たとえば、これは私が現在行っていることです:
// Home page.
$app->get('/', function (Request $request, Response $response, array $args) {
// Get the application settings.
$settings = $this->get('settings');
// Check if the home page class is provided.
... lots of codes
});
$app->get('/home', function (Request $request, Response $response, array $args) {
// Get the application settings.
$settings = $this->get('settings');
// Check if the home page class is provided.
... lots of codes
});
これらのコードのチャンクを繰り返す代わりに、次のようなコードにすることはできますか?
$app->get('/ or /home', function (Request $request, Response $response, array $args) {
...}