In my code, I use a post filter to add something to the header of the generated template code. The changes in 3.1.8 to fix issue 71 breaks this functionality, as it makes the post filters only get passed the compiled template contents, without the surrounding template code frame. So I am no longer able to add something where I need to in the compiled code.

Here is what I was previously doing, using this as a post filter (non-relevent parts removed for brevity):

Code:

<?php
//file: postfilter.process_tags.php

function smarty_postfilter_process_tags ($source, Smarty_Internal_Template $template)
{
$extra = array();//this ends up being an array of useful info used elsewhere
$addSection=false;//gets set to true if we need to add the extra info...
//...

I'm not saying the change for issue 71 was bad, as it does make sense and my own use of post filters is more a fringe/specialized case. I'm asking if something could be done in a future version of Smarty to allow modifying what is generated by createTemplateCodeFrame(), without having to do too much of an ugly hack?

My own thought is maybe add a switch like $smarty->postFilterIncludeHeader = bool, where if it is true, it uses the old behavior and processes post filters after the call to createTemplateCodeFrame(). If false (which it would be set to by default), use the newer behaviour of doing post filters prior to calling createTemplateCodeFrame.

Also I wasn't sure if I should put this as an issue in google, or comment on the already resolved issue 71 to request it, or post it here or what. So if there is a better venue for my request please let me know...