C
C
casey2010-11-01 10:29:56
PHP
casey, 2010-11-01 10:29:56

Which templating engine to take for a new php project?

Many people use Smarty by inertia, someone tries Twig, someone - exotic Blitz, so I want to know the opinion of the public.
Blitz, in my opinion, has a significant drawback - high labor costs for development, since it requires close interaction between the designer and the programmer for changes and for rapid development / prototyping, in my opinion, is not very suitable.
From Smarty-like systems, I only know Twig, maybe there are other good options? From the template engine I want objectivity and extensibility.

Answer the question

In order to leave comments, you need to log in

13 answer(s)
V
Vladimir Chernyshev, 2010-11-01
@VolCh

A good templating engine that perfectly integrates with PHP is called... PHP :) It is convenient to use alternative syntax in templates.

S
Sergey, 2010-11-01
@seriyPS

I recommend XSLT. For it, you can assemble an XML-ku using a SimpleXML thread - very convenient. Each module of the project can insert its data into the same SimpleXML object and then XSLT already selects what it needs.
Of the pluses - it is well transferred between languages ​​(if you suddenly need it), you can use the same XSLT to try to implement the REST API. Yes, it just imposes a fairly correct style when creating templates. Again, for NGINX there are modules for XSL transformation inside it (although I personally don’t see the point of doing templating inside a lightweight asynchronous web server
). will fly.

M
Mikhail Davydov, 2010-11-01
@azproduction

Twig - template inheritance, compiling templates into a readable form (class), all the best from Smarty, sandbox, auto-escaping strings, there are ready-made classes for integration in almost all frameworks. Blitz - it’s very inconvenient to work with templates, it seemed to me very tight for development. The speed of Blitz... this is a dubious advantage - compiled templates twig + eAccelerator will not be inferior to Blitz.

R
Rodion Gashé, 2010-11-02
@zorba_buddha

I wondered all the time why in PHP people are looking for some kind of templating engines.
the language itself is a powerful templating engine.
everything else, except for XSLT + XML - from the evil one.

K
KooL, 2010-11-01
@KooL

Smarty

T
Thomas, 2010-11-01
@Thomas

Can look towards XSLT? Very high separability of code from presentation. In terms of speed, it will probably be slower than the above. But the convenience of working with him often crosses out all the minuses.

D
Dmitry Dedukhin, 2010-11-01
@Demetros

CTPP2
Pros:
- high speed
- extensibility (you can add your own functions)
- one set of data for templating on the server and on the client (JSON)
- a module for templating using nginx has recently appeared, it is not production-ready yet, but I think it will quickly become one

S
s5656, 2010-11-01
@s5656

none, use native templates

M
mayhem, 2010-11-01
@mayhem

I don’t understand why template engines on puff are better and more convenient than puff itself.

D
developer, 2010-11-01
@developer

Quicky:
habrahabr.ru/blogs/php/45337/code.google.com/p/quicky/wiki/Manual I have published quicky reviews
.
I have been using for 2 years

A
akzhan, 2010-11-01
@akzhan

Now a lot of people are looking towards HAML + SASS.
These languages ​​come from the world of Ruby and now there are adaptations for almost every major language.
For example, for PHP you can look at phphaml.sourceforge.net/ , www.yiiframework.com/extension/haml-and-sass/ and so on.

V
Vertex, 2010-11-08
@Vertex

Another plus in the direction of Smarty: Eclipse + Smarty Plugin = free and convenient bundle. After switching to Mac, this is the only comfortable IDE for puffing.
The general answer for those who unsubscribe that "PHP itself is a good template engine":
You either did not work with large projects, or I sympathize with those who support them. Separation of logic and presentation by default should be. XSLT+XML - suitable; Smarty, Twig - too. But the CODE in HTML is really from the evil one.

B
burgua, 2010-11-02
@burgua

github.com/everzet/jade.php
HAML in php. A very handy thing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question