Closed MonkeyTime closed 3 years ago
Hi,
I have a problem with the default value of the first parameter with 2 paramaters defined.
When the first parameter is optional and have a default value Toro seems to not working
class VendorHandler { function get($languri = 'fr-be', $vendor) { include (CONTROLLER_PATH . '/vendor/Get.php'); } } Toro::serve(array( '/?([a-z]{2,2}-[a-z]{2,2})?/vendor/([a-zA-Z0-9-_]+)' => 'VendorHandler' ));
Toro.php line 35
if (preg_match('#^/?' . $pattern . '/?$#', $path_info, $matches)) not matched and no default value because builded on pathinfo.
Toro.php line 69
$regex_matches
How to change this or retrieve the default parameter ?
Optional parameters should always be at the end of a function’s argument list in PHP (or any language, really).
Hi,
I have a problem with the default value of the first parameter with 2 paramaters defined.
When the first parameter is optional and have a default value Toro seems to not working
Toro.php line 35
if (preg_match('#^/?' . $pattern . '/?$#', $path_info, $matches)) not matched and no default value because builded on pathinfo.
Toro.php line 69
$regex_matches
How to change this or retrieve the default parameter ?