I am working for a java team now, but I am using PHP for private case.
My work team are importing Thymeleaf which is a powerful template engine for java.
It can write variables for output or expressions such as if else into tags as attributes, e.g.:
<tr th:each="prod : ${allProducts}">
<td th:text="${prod.name}">Oranges</td>
<td th:text="${#numbers.formatDecimal(prod.price,1,2)}">0.99</td>
</tr>
It also can render in browser normally and without any java's variables or expression completely.
When I use PHP, I know Smarty and twig.
But both of them have to write variables and expressions outside of tags(not as attributions), which displaying in browser.
So I want to know whether there is some way to use Smarty or twig as Thymeleaf does.
Or other PHP template engines can do this easily.
Best regards,
UPDATE
It also can render in browser normally and without any java's variables or expression completely.
I mean this can be done without any parse process.
Just only open files in browser as if there is no any engine.
I have got it!
It's PHPTAL.
Exactly as Thymleaf does!
So wonderful!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With