U
U
urght2016-05-06 13:05:15
PHP
urght, 2016-05-06 13:05:15

Is it worth using a templating engine in php?

In general, is it worth using templating, what are relevant or what types of templating exist, what are the pros and cons? (Let's say for a social network).

Answer the question

In order to leave comments, you need to log in

5 answer(s)
O
OnYourLips, 2016-05-06
@OnYourLips

Advantages of modern templating engines: template inheritance, safety due to auto-escaping, convenient logic in templates, not mixed with business logic.
PHP used to be a templating engine, but by today's standards it's a terrible fit for that role due to the increased quality requirements of a templating engine over the years.
If you want to write PHP code in a template (bad idea), then take Blade (popular in Laravel).
Otherwise, use Twig.

Z
zooks, 2016-05-06
@zooks

Twig seems to be fine.

K
Kuzma Shpagin, 2016-05-06
@demon72

Google what template engines there are and choose your own.

W
WhiteSama, 2015-06-13
@WhiteSama

nav('filling.php?action=fill&amount=' + $('#fillingAmount').text());
what is this for? I understand how many should be specified?

A
Andrew, 2015-06-13
@Ashlst

You have: filling.php?action=fill&amount=
On the filling page: filling.php?action=fill& ; amount =
Try to fix it, maybe it will work) So, it seems, everything is written correctly)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question