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

PHPBB3-12957