为什么在使用 zend 框架时脚本会被赋予 .phtml 扩展名?
最佳答案
据我所知,.phtml
扩展名仅适用于查看文件。
Matthew Weier O'Phinney给出了他为什么建议将 .phtml
用于 View 的原因:
I actually chose .phtml as (a) most apache configurations specify it as an alternate extension associated with the PHP engine, (b) most IDEs and text editors will identify .phtml as PHP + HTML for syntax highlighting, and (c) it visually separates template scripts from other PHP files in the directory tree.
所以这没什么大不了的;它只是更清楚地表明, View 文件主要由散布在应用程序 HTML 模板中的 PHP 组成。正如他在 (b) 点中所说,大多数 IDE 和编辑器都可以识别 .phtml
文件,因此您在处理它们时应该不会遇到麻烦。
关于php - 为什么在使用 zend 框架时脚本会被赋予 .phtml 扩展名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3053050/