We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Will there be a Thymeleaf in PHP?

When I use Java, my favorate Template Engine is Thymeleaf [https://www.thymeleaf.org/], it is really a great Template Engine and it is the most great template engine I've met. the great idea of thymeleaf is to use the namespace of attribute to work with the tempate, and make the tempate staticly view-able (run the code is not necessary )

with dynamic style sheet link you can code like that:

<link ret="stylesheet" href="../../../css.css" th:href="${site_url}/static/css.css">

when you preview it staticly, the ../../../css.css will be loaded and the final look you will see. when you run it, the href attribute will be relpaced with the th:href. I did think that is a really designer friendly template engine.

all the code must to be placed in the attribute. that will not cause the browser parse failed (by staticly preview)

<span th:text="${body}">Hello World!</span>

the output will be

<span>The Dynamic Body</span>

Is there any thought about a PHP implimention of Thymeleaf ?

There are plenty of template engines in PHP (including PHP itself). Here is a list that seems to cover everything that isn't volt:

https://www.webresourcesdepot.com/19-promising-php-template-engines/

If you really need the Thymeleaf syntax, then you might have to prepare for disappointment.



17.8k
Accepted
answer

There are plenty of template engines in PHP (including PHP itself). Here is a list that seems to cover everything that isn't volt:

https://www.webresourcesdepot.com/19-promising-php-template-engines/

If you really need the Thymeleaf syntax, then you might have to prepare for disappointment.

Very appreciateļ¼ I just found that the PHPTAL has some features like thymeleaf. may i cna try the PHPTAL[https://phptal.org/]



17.8k

There are plenty of template engines in PHP (including PHP itself). Here is a list that seems to cover everything that isn't volt:

https://www.webresourcesdepot.com/19-promising-php-template-engines/

If you really need the Thymeleaf syntax, then you might have to prepare for disappointment.

And also the HTML_Template_Flexy