Sounds like you didn't explored all the capabilities of the phpBB 2.0.x template system
. Believe me, using the template system, you can have dynamic template resulting in a var without any display (very usefull to generate ie txt/php files, or email
), and in a perfectly correct way : even the various template caches (phpBB contrib dir or extreme style mod) handle this softly
I know, but your code that you pasted wasn't using it correctly. If you would write in that code that you dynamically assign filename to handle then it would be code that you wanted.
Ptirhiik wrote:If you do that, you will be tied with your server configuration, and from there it is not a solution than can be choosen.
No. It works with all configurations.
Ptirhiik wrote:BTW, it will require to process an echo, what I don't want : only the result of parsing interests me, what perfectly do the assign_var_from_handle() function. The pparse() is never done during this process.
I don't think you looked at code of old template.php close enough. in 2.0 assign_var_from_handle() does same as pparse() - it compiles template and runs it. But unlike pparse it puts content to string instead of echo() and that's slower than echo because of constant contecating.
And you didn't look close enough at compiled template code for 2.2 ether. It doesn't use echo().
Using buffering is much faster than assigning to variable. Besides, assigning to variable will require different compilation and execution method and that will slow down 2.2 templates system a lot. I don't see point in adding one slow function that will require to slow down everything else when you can use fast buffering instead.
Ptirhiik wrote:What you are proposing here is hardcoding all the outputs in the main script, for names and numbers.
Ptirhiik wrote:What allows phpBB 2.0 system is to use any templates, unknown from the main script, to be used to fill a single main var, and so have a plug-ins capability (new feature => new func and new templates, 0 modifications of the main script nor main template). At this time, I really don't figure how it can be covered by the templating system of phpBB 2.1 .
You can do exactly the same in 2.2 by buffering output. Instead of assigning content to variable better echo that content and use buffering to catch all data - its much faster and more flexible than old method.