Pass custom parameters via Class@Method?
sephentos opened this issue · comments
sephentos commented
Hi,
is it possible to pass custom parameters via Class@Method?
I am aware that something like this works:
class Handler {
public static function detail($name) {
echo 'Hello ' . htmlentities($name);
}
}
$router->get('/hello/{name}', 'Handler@detail');
Any way to pass parameters which detail
may require?
e.g.
public static function detail($name, $customPar, $customPar2) {
...
$router->get('/hello/{name}', 'Handler@detail', $customPar, $customPar2);
Tim Riedl commented
No, these parameters are only for dynamic routes. If you need to specify any variables or constants, please do that within your method or instance. If you can tell me, what you want to do specifically, I can maybe give you advice how to optimize your procedure
~ Tim ✌🏻