-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
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
routes => middleware => multiple actions does not get lazy loaded #18
Comments
It depends on what code you have in those actions. Usually you return a Response object in an action middleware. Which basically means you will not execute the second action but go back through all the previous middleware. What you can have in that middleware is something like this: 'middleware' => [
Middleware\SessionMiddleware::class,
Middleware\AuthMiddleware::class,
Action\PostAction::class
], Originally posted by @geerteltink at zendframework/zend-expressive#361 (comment) |
Both actions return $next(...) if there is $next. test.global.php
App\ErrorHandler.php
App\TextAction.php
App\TestAction2.php
Without any error you will get an
If you now force an fatal error in
Got: empty If you now force an fatal error in Expected:
Got:
For some reason the Originally posted by @cottton at zendframework/zend-expressive#361 (comment) |
@sergu44o What version are you using? This issue is almost 2 years old. Originally posted by @geerteltink at zendframework/zend-expressive#361 (comment) |
Example:
config
Im using a middleware (priority PHP_INT_MAX) to catch fatal error (
register_shutdown_function
).When im using one action only in the config
and when i force an fatal error in that action
the registered shutdown function gets called.
If im using two actions as shown above
then no registered shutdown function gets called.
The middleware im using wont be invoked/loaded before the action.
Originally posted by @cottton at zendframework/zend-expressive#361
The text was updated successfully, but these errors were encountered: