What is phtml, and when should I use a .phtml extension rather than .php?

后端 未结 6 1878
逝去的感伤
逝去的感伤 2020-12-04 05:57

I\'m wondering what the difference between .phtml and .php files is, and when to use one over the other.

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-04 06:22

    It is a file ext that some folks used for a while to denote that it was PHP generated HTML. As servers like Apache don't care what you use as a file ext as long as it is mapped to something, you could go ahead and call all your PHP files .jimyBobSmith and it would happily run them. PHTML just happened to be a trend that caught on for a while.

提交回复
热议问题