顶级和低级 PHP 脚本的含义是什么?

What is the meaning of top level and low level PHP scripts?

在许多 PHP、PHP MVC 和 PHP 面向对象的书籍中,它们将各种脚本称为顶级或低级。如果 PHP 脚本是顶级或低级 PHP 脚本,这意味着什么?

In formal MCV structures, you would use objects as Controllers. Here, individual PHP scripts will act as the Controllers. However, just as in formal MVC, the Controllers will not contain or generate any HTML, pushing that onto the views, which are individual HTML files. As you'll see, the View files are primarily HTML, with very little logic, which is to say only the bare minimum of PHP code. The Models will always be classes. The Controllers are represented by top-level PHP scripts.

我认为 "top level" 在这种情况下,他们只是指持有控制器的脚本位于应用程序堆栈链的顶部,它是应用程序的入口点,当您访问任何 url.

时,首先在您的代码库中被命中

历史上 php 应用程序的编写方式是,包含 html 的文件 "top level" 中嵌入了一些 php。

现在流行的 php 框架使用 MVC 风格的架构,其中应用程序的入口点是 php 唯一的控制器,持有 html 的文件仅在稍后包含在调用堆栈中。