Add register_shutdown function is most accurate

It's good function with Twig. You can choose position on HTML code, or just add on end file, when php code shutdown (terminate).