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

[ticket/13110] Add core event to the page_footer() function #3000

Merged
merged 1 commit into from Oct 2, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions phpBB/includes/functions.php
Expand Up @@ -5278,6 +5278,18 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
}
}

/**
* Execute code and/or modify output before displaying the template.
*
* @event core.page_footer_after
* @var bool display_template Whether or not to display the template
* @var bool exit_handler Whether or not to run the exit_handler()
*
* @since 3.1.0-RC5
*/
$vars = array('display_template', 'exit_handler');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need these variables?
Sounds pretty dangerous to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickvergessen Yes, in case you would like to override default output behavior, f.e. filter the whole page before displaying etc., roughly

 
ob_start();
$this->template->display('body');
$content = ob_get_clean();
/* Do something with $content here */
$event['display_template'] = false;

extract($phpbb_dispatcher->trigger_event('core.page_footer_after', compact($vars)));

if ($display_template)
{
$template->display('body');
Expand Down