我正在寻找指导我了解 Controll 功能和编写自己的控制器 + 模型的最佳实践的教程/书籍
I am looking for a tutorial / book that guides me to understand the Controll functions and the best practices to write my own controller + Model
提前致谢.
我确信已经发布了很多链接来帮助您入门,但是创建 MVC 的一些重要因素是:
Im sure theres plenty of links been posted to get you started but some important factors in creating an MVC is:
Model_Database
)Library_session
会加载/library/session.class.php
)它们只是您在创建系统时应该考虑的一些提示和想法.
They are just a few tips and ideas you should be thinking about when you create your system.
您还应该做的是使用其他框架并构建一些示例项目,了解应该如何使用 MVC 框架,所以当您构建一个时,您知道用户应该期望什么,然后真正研究框架的核心结构.
What you should also do is user other frameworks and build some sample projects, learn how an MVC Framework should be sued, so when your building one you know what the user should expect, then just really study the core structure of the framework.
在 PHP 中考虑以下通常是 MVC 的工作方式
Take into consideration in PHP the following are usually how MVC Works
但您可以使用 MVCL
,即 (M odel/V iew/C ontroller/L 语言)
but you can work with a MVCL
which is (M odel/V iew/C ontroller/L language)
语言不是原始文档中的特定语言,但在模式结构方面被采用了几次,下面的文件结构示例将引导您了解 +L的主要用途强>
Language is not a specific in the original documentation but its been adopted a few times in regards to the pattern structure, An example of the file structure below will guide you into whats the main purpose of the +L
M: catalogmodelcatalogproduct.php
V: catalogview emplateproductproduct.tpl
C: catalogcontrollerproductproduct.php
L: cataloglanguageenglishproductproduct.php
公司/项目使用这种方法的一个例子是:OpenCart,我强烈建议你看看架构!
An example of what company / project uses this method is: OpenCart, AND I HIGHY RECOMMEND YOU LOOKING AT THE ARCHITECTURE!
这篇关于MVC - 控制器类教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!