Man, I don't believe the hack I just had to do to make Smarty to do what I want. I didn't have to modify any of Smarty's code, but it involved a Smarty prefilter that parses a given template for all variable references, then writes out PHP code to execute in the template that calls my CMS to dynamically generate and assign template variables to Smarty corresponding to those variables.
But, this enables the right MVC separation I elaborated earlier. The prefilter overhead is only involved on the initial template parse, and there's really not much overhead for much else. Plus, all this kludgy code I had to write only took a few dozen lines. So all in all it's not too bad.
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):