The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
get template function
I'm sure this is really simple.
I'm trying hard to get my head around the gettemplate function, how it works with $variables and the template code. for example what exactly does eval( '$statistics = "' . gettemplate( 'home_statistics' ) . '";' ); mean?? Am I right in thinking that its simply assigning to $statistics the code in the template 'home_statistics'? Hmm probably yes. but how do I then pass another variable, say, $info to the template so that its value appears in $statistics? Or don't I have to do anything explicit? Are all PHP variables globally visible? is there a thread somewhere with a quick tutorial on this? I'm getting really confused. |
#2
|
||||
|
||||
gettemplate('home_statistics') just gets the tempölate home_statistics out of the db.
it's just a string then. the eval means, that the string gets parsed as it would be in real php files, that's how the variables get parsed. you can use every variable in your template which is defined in your calling function (-> every var you can access in this function can also be used in the template) |
#3
|
||||
|
||||
Thank you Xenon, that is very clear. A great help.
Matthew |
#4
|
||||
|
||||
np, you're welcome
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|