Skip to content
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

Allow 'before_error_render' hook to modify token values passed to the rendering engine. #1218

Merged
merged 1 commit into from Jun 29, 2022

Conversation

mmcclenn
Copy link
Contributor

The 'before_error_render' hook is now called with two arguments. The
second argument is a hashref holding the tokens that will be passed to the
template rendering engine. This gives that hook an opportunity to modify
the token values, and even more importantly to add any extra tokens
necessary for the proper rendering of the error template.

This change gives 'before_error_render' the same functionality that is
already provided to 'before_template_render', putting it on an equal
footing.

second one is a hashref holding the tokens that will be passed to the
template rendering engine. This gives that hook an opportunity to modify
the token values, and even more importantly to add any extra tokens
necessary for the proper rendering of the error template.

This change gives 'before_error_render' the same functionality that is
already provided to 'before_template_render', putting it on an equal
footing.
@mmcclenn
Copy link
Contributor Author

I had to patch my local version of Dancer to do this, which sticks in my craw. Can you please merge this? I cannot think of any good reason why before_error_render should not have access to the same information that before_template_render already does.

@bigpresh bigpresh merged commit de4c5a5 into PerlDancer:devel Jun 29, 2022
@bigpresh
Copy link
Member

Hilariously belatedly, but thanks!

@mmcclenn
Copy link
Contributor Author

mmcclenn commented Jun 29, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants