Quote:
Originally Posted by amcd
Templates are not supposed to execute code. This is not just with vbulletin, but the entire concept of templating is separation of presentation from code (business logic).
Execute the php before calling the template, keep the presentation data in certain variables, and use the template just to show those variables.
|
Quite clear, can you please make an example ?
Suppose I have some pages I need to execute and show : page1.php, page2.php, page3.php
I should create some templates : template1, template2, template3
Then insert the variables : $show1 (containing the html execution of page1.php) into template1, $show2 (containing the html execution of page2.php) into template2 and so on.
But how can I generate/fill (for example) the variables and insert them into the template when I link the user to mysite.com/forums/page2.php ?
--------------- Added [DATE]1216770050[/DATE] at [TIME]1216770050[/TIME] ---------------
Found, may be, I should add a plugin :
Code:
ob_start();
include('./page2.php');
$show2 = ob_get_contents();
ob_end_clean();
Is it ?