I actually have a templete library based off of the ideas you posted. Although its not in a class. Its just a set of functions.
My parse function looks like this:
function ParseTemp($string, $ent, $null = '')
{
while ($each_ent = each($ent))
$string = str_replace("<!--$".$each_ent[0]."$-->", ((is_array($each_ent[1])) ? '' : $each_ent[1]), $string);
if($null == true) // null out any stragglers
$string = preg_replace("/<!--\\$[^ \\$]*?\\$-->/s", '', $string);
return $string;
} // end function ParseTemp($string,$ent)
My parsing is based on an associative array containing the strings I want to swap into the template.
This function allows me to blindly pass an array (which could contain subarrays - it'll check for that instead of bombing out). I pass along the template as a string to work with. Then there's an additional parameter to clear out all variable tags in the template. This has been supper handy for clearing out any stragglers and has been handy for leaving them in for later processing.
As you may notice, I use <!--$ and $--> for my tags. This will cause MAJOR problems in Java (used <!--% and %--> instead). I went this route so I didn't accidentally pick off any HTML comments that one might sprinkle in the page. This is your library so I'll let you decide if this will be a problem or not.
As to your original question about the flow, classes make things a little sticky here. I really wish to make my template system a class, but I haven't figured out a good way of keeping track of the variable data.
The beauty of the associative array is $POST, $GET, and mysql_fetch_array() all return associative arrays which work awesome with my ParseTemp function.
The flow I use is: load the template from a file (I put all the HTML into a template which also contains the template variables <!--$[var name]$-->). Then I have my code do whatever it needs to. Then I load up the array I wish to use to populate the template. About 90% of the time, I'll be using $POST or $GET since a lot of the web deals with form data (and templating allows the user's data to be redisplayed pretty easily). When I'm all set, I just call the ParseTemp() function and echo the results. This, I think, is pretty close to what you had posted. It feels a little clunky at first, but it works. I'm not sure if having it all in a class is what it making it clunky. I'd love to see this in a class where it wasn't so clunky.
If you wish to see my template library, let me know (maybe via PM). It may or may not spark some ideas...