12
Until recently, I had never heard of phtml
, but recently I see that it is being used a lot, mainly by some frameworks (such as Zend2).
Since I can normally put html content inside a file .php
, I wonder what is the use of using a file .phtml
?
Some points I would like to know:
- It has some performance or interpretation advantage?
- When should I choose the extension
.phtml
? - This extension was created for what purpose?
It is also interesting to say that phtml files can be displayed without a web server, obviously php itself will not be rendered, but html can be seen, thus facilitating code changes in any environment.
– Rafael Rezende