[ticket/12957] Update the constructions of the template engine

https://tracker.phpbb.com/browse/PHPBB3-12957

PHPBB3-12957