PDA

View Full Version : Calling function from template


ZomgStuff
11-24-2007, 03:12 AM
I'm a noob so sorry, but here is my question.

I want to call a php function from a template.

Basically in the php file lets say I have a function
function test($testvariable) {
echo $testvariable;
}

$testcall = test("lol");


Now how can I call $testcall from a template?

Thanks

Marco van Herwaarden
11-24-2007, 06:13 AM
You can't. Templates are HTML, not PHP.

Create a plugin with your PHP code. If needed asign the output to a variable that can be used in your templates.

ZomgStuff
11-24-2007, 01:23 PM
That makes sense, thank you.