O
O
Optimus2017-01-23 22:17:49
PHP
Optimus, 2017-01-23 22:17:49

Are templates still up to date?

Template engines like Smarty, Twig are in demand in 2017, if you haven’t worked with them before, is it worth watching, studying to increase your value in the labor market? Or did their native php supplant them, or did they all go to Frontend templating engines?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
E
Eugene Volf, 2017-01-23
Pyan @marrk2

Template engines like Smarty, Twig are in demand in 2017, if you haven’t worked with them before, is it worth watching, studying to increase your value in the labor market?

Smarty - hardly.
Twig is quite relevant, I’ll even tell you more, it is already integrated out of the box into a fairly popular CMS called Drupal 8 (because it is based on Symfony) and, in fact, into an equally popular framework called Symfony. And, Twig fits perfectly into a very popular framework (I mean, in the PHP-* perspective) called Laravel, which in turn also has its own very good templating engine called Blade.
Among other things, there is even a variation of Twig for JS (Node.JS), as an alternative to things like Pug/Jade for example. *According to one of our colleagues, such templates (in the JS version of the interpreter) are perfectly transferred later to the original Twig / PHP (they have good compatibility / portability).
* I did not check it myself, but I trust the words of the author.
They usually have slightly different task categories. If you are talking about templating engines a la Pug/Jade, what comes out of them into the final non-JS code does not integrate well. That is, the meaning of this templating engine is only for the one who does the layout, there is usually no practical benefit from it when transferring it to the PHP engine (and other non-JS engines), or very little.
If we talk about purely client implementations - to generate data on the client, in such a volume, in my opinion, is not kosher in the vast majority of cases, given that the server can cache the entire page and immediately issue it ready (Varnish, for example, if we talk about the need high performance), and some half-dead smartphone, the poor fellow who visits such a site, will burst from the excessive abundance of JS code.

T
trevoga_su, 2017-01-24
@trevoga_su

php is the best templating engine if you include a little head
www.phpinfo.su/articles/practice/shablony_v_php.html

Y
Yuri Bogoslavets, 2019-07-17
@uranik

It's better to learn vue/angular/react and you won't need template engines.

K
k0nsu1, 2017-01-27
@k0nsu1

smarty is still used in prestashop

A
Alexander Reshetnyak, 2018-07-11
@Vampireos

smarty is still relevant, no need to pump it up)
somewhere there was a comparison of template engines and it even in some moments is in a better light than the new ones

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question