Get full parsed output from template

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Get full parsed output from template

Post by Erpenator »

I would like to have the full output of phpbb from \phpbb\template\template so I can store it in memcached and generate an (HTML) output via the main caching server we have in place.

So far I have created an extension to pass all the classes I need:

Code: Select all

public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\cache\service $cache)
    {
        $this->auth = $auth;
        $this->config = $config;
        $this->template = $template;
        $this->user = $user;
    }
I am using the hook 'core.posting_modify_submit_post_after' => 'posting_modify_submit_post_after' to catch the output and tried different ways to get the output without succes. When I var_dump $this->template->display('body') I can see the output, but I am not able to find to only output the HTML.

The goal is to return HTML output as soon as possible to the page doesn't need to be regenerated again. At this moment the forum is too slow, mainly due to extensions and modifications we need and can't optimize any further.
rxu
Extensions Development Team
Posts: 3404
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: Get full parsed output from template

Post by rxu »

I guess it's something like $html = $this->template->assign_display('body');.
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: Get full parsed output from template

Post by Erpenator »

rxu wrote:
Sun Dec 22, 2019 11:31 am
I guess it's something like $html = $this->template->assign_display('body');.
This worked perfectly! Thank you.
Post Reply

Return to “Extension Writers Discussion”