什么是phtml,什么时候应该使用.phtml扩展名而不是.php? [英] What is phtml, and when should I use a .phtml extension rather than .php?

查看:371
本文介绍了什么是phtml,什么时候应该使用.phtml扩展名而不是.php?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道.phtml和.php文件之间的区别是什么,以及何时使用它们之间的差异.

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

推荐答案

就页面渲染而言,通常没有区别.但是,当您的Web项目变大时,这是开发人员方面的一个巨大功能.

There is usually no difference, as far as page rendering goes. It's a huge facility developer-side, though, when your web project grows bigger.

我以这种方式使用两者:

I make use of both in this fashion:

  • .PHP 页面不包含与视图相关的代码
  • .PHTML 页面包含很少(如果有的话)数据逻辑,并且大部分与演示文稿相关
  • .PHP Page doesn't contain view-related code
  • .PHTML Page contains little (if any) data logic and the most part of it is presentation-related

这篇关于什么是phtml,什么时候应该使用.phtml扩展名而不是.php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆