MyBB Community Forums

Full Version: Who uses php in templates?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I'm still pondering the idea of using php in templates...should I go for it?

Do you use php scripts in your templates?

What security methods do you use in addition to your use of php in templates?
Programming in templates is considered a bad practice in just about everything (python, ruby, and php).
True but i dont think for every little small thing having a plugin would be needed.
The easiest example i think would be lets say you show ads to one group and not to another. You could take a complex plugin or just add the two lines of html code.
Wrap a php if around it (with php in templates) or use the template conditions <if> </if>.

Ah well i find the php in templates plugin quite useful, even if the template conditions is the real reason i use it.
For me, everything that required (complex?) PHP is possible with a plugin and I write it, for simple tasks (if/elseif/else) I use the Template Conditionals plugin, so I voted yes.
I was talking in general not just MyBB.
Any modern PHP framework uses PHP in views. Doing it otherwise is what would be a bad practice, because you would end up mixing your logic with your HTML.
I'll definitely recommend using this plugin. It makes life much easier.

Welldone Yumi!
I am seriously considering using it, I guess there really is no reason not to, right?
If you need it and it fits your needs, then I see no reason not to use it.
(2012-09-29, 06:17 PM)Fábio Maia Wrote: [ -> ][...] because you would end up mixing your logic with your HTML.

Not that views do that. Shy
Pages: 1 2 3