XF 2.1 can i use php and sql in addon templates?

punisher1

Member
hey i have addon, and in this addon's templates, i want to use php (for example: include "db.php";) and i want to get some content from my database with some mysqli select * from stuff..

so can i do this? how can i do this? im so beginner in xenforo coding style so i dont understand this object oriented method. all i need to know is how can i put my php codes into that template without problems
 
Short answer:
You can't.

More complex answer:
You could use callbacks or add your own templater methods to execute code, though I wouldn't recommend doing that, usually the proper way is to write your own controller, services, etc.
 
Is there any detailed tutorial for this? I'm very new. A video (which shows creating a simple stuff like you've mentioned in complex answer) would be great.
 
man u need to add php support. i dont know this callback templater etc stuff just let me use my own php code inside forum i need to make some sql querys .
 
Back
Top Bottom