Welcome Guest, Not a member yet? Register   Sign In
PHP template engine
#1

[eluser]GlennJ[/eluser]
I've been looking into the different template engine options out there and have not come to any decision yet.

Smarty is old now, Dwoo is new but looks quite good, Sugar looks nice but not very popular... the list goes on!

Does anyone have any input on this topic? What do you use and why?
#2

[eluser]umefarooq[/eluser]
after reading this post i googled best php template engines well i found one good Rain template engine it looks simple and good to me, Dwoo is also good if you want to use Dwoo with CI you can read how to use Dwoo with CI

http://philsturgeon.co.uk/code/codeigniter-dwoo
#3

[eluser]umefarooq[/eluser]
Rain template url, sorry for spam.

http://www.raintpl.com/Home-1
#4

[eluser]bhogg[/eluser]
Why not just use PHP using template-style notation? ie.

Code:
<?php if (!$var): ?>
My text
<?php endif; ?>

<?php foreach ($vars as $var): ?>
    <td>&lt;?php echo $var; ?&gt;</td>
&lt;?php endforeach; ?&gt;

I have yet to see instances where the overhead of a templating engine offers any significant benefits. Happy to be proven wrong Smile
#5

[eluser]GlennJ[/eluser]
Not an option as the templating system will be in the control panel, like Expression Engine. Otherwise I would agree with you.

However, I can't have people (designers) chucking PHP in, far too dangerous ;-)
#6

[eluser]Myles Wakeham[/eluser]
We use Smarty extensively mainly because when we started to integrate it with CI back in 2006, it was the defacto standard amongst the graphic designers we have to work with. I think that is really the key here - what is your business need for a template engine? If its just for you to use to speed up development, then go with what makes the most sense for what you need. But if you have to work with graphic designers who do all the aesthetic work on the site, go with something that you feel they can live with, and will keep them out of your code yet has the flexibility to support their goals as well.

If you think you may need a graphic designer at some point in the future, Smarty might be worth considering because its pretty commonplace in that world.

Myles
#7

[eluser]GlennJ[/eluser]
Yeah, I think it's either Smarty or Dwoo by the looks of things. Think I just need to have a proper play with Dwoo to see what it's capable of. Apparently it is compatitble with Smarty templates...
#8

[eluser]Myles Wakeham[/eluser]
Keep in mind performance impact of this. Smarty does tend to have some overhead with performance, although the sizes of the sites I've used it on don't seem to show much of an impact.

Myles
#9

[eluser]Tominator[/eluser]
COMPER Template Parser

You can fonud it here, or in: http://parser.comper.sk
#10

[eluser]WanWizard[/eluser]
[quote author="Myles Wakeham" date="1276725566"]Keep in mind performance impact of this. Smarty does tend to have some overhead with performance, although the sizes of the sites I've used it on don't seem to show much of an impact.[/quote]
We standardize on Smarty as well, altough being modular other template engines can be used as well.

Most of our (commercial) customers require code and design separation, and quite a few are familiar with Smarty's syntax. Yes, you pay a little bit in performance, but hardly noticable, even on our high volume sites, compared to other performance factors.

We're testing with the RC of Smarty3, and overall see a 20-40% increase in performance.

Most of the other template engines out there are very limited in terms of syntax, limiting what a designer can do with it...




Theme © iAndrew 2016 - Forum software by © MyBB