klein/klein.php

URL not matching in a case, I don't understand why

Closed this issue · 1 comments

Hello, I have the following piece of code, which doesn't match something I thought it should:

$router->respond('GET', '/[a:Language]/[**:pagePath]?', function ($request,$respond,$service) {
	$_SESSION['Language'] = $request->Language;
	$service->pagePath = $request->pagePath;
});

It matches /en/contact
But doesn't match /en/

Shouldn't it match /en/ as well, since after the [**:pagePath] condition there is a '?' that means it's optional?

Thank you, if I need to provide more info, I will.

Moved the project to a framework, like most people do.