Which template engine do you use..?

#21
[eluser]meovino[/eluser]
Add one more for pure PHP. Of course, we do plain old Model 2 JSP and servlets at work, so CI really fits pretty well with that line of thinking. Being able to run a view into a variable, then pass that into another view is just pure genius.

We have started playing with Groovy and Grails at work, and Grails uses SiteMesh as a templating engine. If I were to use any templating engine in PHP, it would be something like SiteMesh.

[quote author="Code Arachn!d" date="1204940512"]I agree with Elliot Haughin - PURE PHP POWER!!! - although I have a crazy "templating" system based on the file extensions (.html => html, .m => mobile, .rss =>... you guessed it XML)[/quote]

#22
[eluser]wiredesignz[/eluser]
Theres nothing wrong with Pure PHP in Views, but why would you want to type <?php echo $blah; ?> instead of {blah} all day long, parsers have their place, provided they dont make development slower and don't place too much overhead on rendering.

I have created an enhanced version of the CI parser as a static helper, it allows the use of function calls inside views. http://ellislab.com/forums/viewthread/72929/

The most important thing to remember here is that the CI Parser (and mine) still allow the use of Pure PHP in Views and they are fast.

#23
[eluser]dmiden[/eluser]
I did try the lightweight 'TemplatePower'. But I find a PHP framework to be more suitable.

#24
[eluser]gungbao[/eluser]
simply write

Code:
<?=$blah?>

even with its two cache stages - smarty is a really HUGE overhead, ever counted the lines of smarty core-code - huh! PHPs hardest performance implications are paring & compiling. so without an opcode cache - its really worse compared to codeigniters raw php templates - and keeping its output cache updated can end up in a mess.

#25
[eluser]Elliot Haughin[/eluser]
Quote:but why would you want to type <?php echo $blah; ?> instead of {blah} all day long

I'd rather put a little more time into building the app than make each request slightly slower, costing a great deal of time and resources over an extended period.

And yeah, just use short syntax: <?=$raw_php_rules?>

#26
[eluser]wiredesignz[/eluser]
[quote author="Elliot Haughin" date="1205207774"]I'd rather put a little more time into building the app than make each request slightly slower, costing a great deal of time and resources over an extended period.[/quote]

Isn't that what a cache is for?

For me, having cleaner templates is the thing. Wink

#27
[eluser]Elliot Haughin[/eluser]
I suppose... I tend to make my templates quite neat, using php...
But I'd rather optimize at every step of the application... so, if I can scale for longer because i have raw php views, then use caching later.... That's me sold every time.

#28
[eluser]Techie-Micheal[/eluser]
[quote author="Elliot Haughin" date="1205207774"]
Quote:but why would you want to type <?php echo $blah; ?> instead of {blah} all day long

I'd rather put a little more time into building the app than make each request slightly slower, costing a great deal of time and resources over an extended period.

And yeah, just use short syntax: <?=$raw_php_rules?>[/quote] short tags are deprecated and I think CI is the only framework that rewrites them.

#29
[eluser]gdgray[/eluser]
I've jumped on and off the Smarty bandwagon over the years and after much investigation, am currently a proponent. One of the misconceptions I've had was over the processing overhead until I discovered the real purpose of the template_c files. They contain the PHP code after Smarty is done converting from it's syntax to pure PHP. Unless you modify a template, the template_c version is used for all subsequent page loads with just a slight overhead check of whether or not the template has been updated. This is very little overhead. Granted, it is loading into memory along with all the crap I write, but it isn't doing much after that unless I'm updating things.

Smarty makes the job of coding the templates so much easier that I just can't justify using the PHP syntax anymore, knowing that it will be "converted once" and "used many" behind the scenes anyway.


gdgray

#30
[eluser]dtrenz[/eluser]
[quote author="Techie-Micheal" date="1205211255"]short tags are deprecated and I think CI is the only framework that rewrites them.[/quote]

where did you see that short_open_tag was deprecated?

you don't need to have CI or anything else rewrite them if you can just turn it on in php.ini


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.