We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
It's now impossible to do something like
$app->register('myfunction', function($arg1, $arg2) { var_dump($arg1); // return NULL })
$args are not passed to function
I suggest to change App.php, at line 95 from: $instance = $closure(); to $instance = call_user_func_array($closure,func_get_args());
$instance = $closure();
$instance = call_user_func_array($closure,func_get_args());
Giving the possibility to use $app->myfunction("argument1","argument2");
$app->myfunction("argument1","argument2");
Thks by advance!
The text was updated successfully, but these errors were encountered:
You should use closure.
$app->register('myfunction', function($result) use ($arg1, $arg2) { var_dump($arg1); })
$result will be returning value of your function.
$result
Sorry, something went wrong.
Doesn't work... My goal is to pass $arg1 and $arg2 dynamically when I will call this service:
$klein->respond('GET', '/', function ($request, $response, $service, $app) { return $app->myfunction('foo',['foo','bar']); });
thanks for advises,
No branches or pull requests
Hi,
It's now impossible to do something like
$args are not passed to function
I suggest to change App.php, at line 95 from:
$instance = $closure();
to
$instance = call_user_func_array($closure,func_get_args());
Giving the possibility to use
$app->myfunction("argument1","argument2");
Thks by advance!
The text was updated successfully, but these errors were encountered: