- The PHP short tag
<?= $var ?>has been deprecated for a while. - Almost all PHP frameworks use the long form
<?php echo $var ?>(e.g., symphony, Yii, Kohana) - Smarty is a famous PHP template engine which supports a shorter form
{$var} - Template engines (like Smarty) are easier for web designer
- Editing a template shows
{$var}instead of showing nothing (because of<..>) - Shorter syntax (less typing especially when
<>are on the same key on some keyboard layout) - The templates are pre-compiled and cached giving nearly the same performances
- Editing a template shows
All those points make me wonder, why do all framework seem to use the super long PHP syntax? Is there a strong point of not using a template engine like Smarty (except the small overhead)?
{$description}displayed while if you use PHP<?...?>you don't see anything there. That also helps validating PHP (directly in the HTML editor). I don't say that to push Smarty3, just to point out my wonder. The best reason given so far is being more flexible and it can easily be implemented.