如何将硬编码网站转换为 PHP MVC 框架网站?
我想转换我们学院的硬编码网站。
我应该遵循任何模式来实现高效和高效吗?快速转换?
请指导我。
I would like to convert our college's hard coded website.
Should i follow any pattern to achieve efficient & fast Conversion ?
kindly guide me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MVC 是一回事,但为什么不先尝试将其分成两部分呢?
例如,将其视为相互通信的两个部分,即客户端和服务器。
“客户端”部分包含用于显示的元素,并将用户的操作传递给“服务器”。
现在“服务器”应该包含其他所有内容。你的“客户”部分最终将成为V(iew)。
一旦成功,您就可以集中精力将“服务器”撬入M和C中,您的“客户端”部分可能也会有一些C部分。
无论如何,这是我在转换而不是重新设计时遵循的一般规则。
MVC is one thing, but why not try to pry it into two sections first?
For instance, think of it as two parts communicating with each other, there's the client and server.
The "client" part is what contains the elements for display and passes actions by the user to the "server".
Now the "server" should contain everything else, for now. Your "client" part is what will eventually become V(iew).
Once this works, you can concentrate on prying the "server" into M and C, your "client" part will probably have some C parts in it, too.
Anyways, that's the general rule I follow, when converting and not redesigning.
这取决于您必须处理多少特定的 PHP 代码...仅当您必须构建常规 CMS 不提供的功能时,您才会使用 PHP 框架。
This depends how much specific PHP code you have to handle... You would use a PHP framework only in the case you have to build functionalities which a regular CMS does not provide.