久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 PHP 中從頭實現 MVC?

How to implement MVC from scratch in PHP?(如何在 PHP 中從頭實現 MVC?)
本文介紹了如何在 PHP 中從頭實現 MVC?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想用 PHP 從頭開始??實現 MVC 因為我想完全控制我自己的代碼并且沒有來自現有框架的額外負擔.任何人有什么建議嗎?

I would like to implement MVC from scratch in PHP because I want full control of my own code and no extra bagage from existing frameworks. Anyone who has any advice?

是的,我看過 Lerdorfs 的文章,看來代碼畢竟不多.實際上,我更希望有一個控制器視圖解決方案來構建我的應用程序.我將堅持使用我自己自制的 PDO 數據訪問類.

Yes, I've seen Lerdorfs article and it seems that it ain't so much code after all. Actually I would more like to have a controller-view solution for structuring my application. I'll stick to my own homemade PDO data-access classes.

推薦答案

你的問題有點像 Not-Invented-這里-綜合癥.在這種情況下,我的建議是,當您可以確定現有框架已經過全面測試和支持時,要忍受它們的額外負擔.不要重新發明輪子.

Your question somewhat smells like Not-Invented-Here-Syndrome. In this case, my advice would be to live with the extra baggage of existing frameworks when you can be sure they are thoroughly tested and supported. Don't reinvent the wheel.

另一方面,上述論證會阻止編寫新的框架.從頭開始編寫一個是學習和理解 MVC 模式的一個很好的編碼練習.

On the other hand, the above argumentation would prevent new frameworks to be written. And writing one from scratch is a good coding exercise to learn and understand the MVC pattern.

所以如果你真的下定決心去做,我的建議是學習MVC的每個部分是,是,以及它們如何相互作用.你也不可避免地會遇到FrontController 模式,所以你也想了解這個模式.

So if you are really determined to do it, my suggestion is to learn what each part of MVC is, does and how they interact. You will inevitably come across the FrontController pattern as well, so you will want to learn about this one too.

請注意,您不是唯一想這樣做的人:

Note that you are not the only person wanting to do this:

  • http://www.google.de/search?q=front+控制器+php
  • http://www.google.de/search?q=build+your+own+mvc+php

還有 Rasmus Lerdorf 的這篇有趣的文章

And there is also this interesting article by Rasmus Lerdorf

  • http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html

這篇關于如何在 PHP 中從頭實現 MVC?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Action View Helper in Zend - Work around?(Zend 中的動作視圖助手 - 解決方法?)
Is this a good way to match URI to class/method in PHP for MVC(這是將 URI 與 PHP 中用于 MVC 的類/方法匹配的好方法嗎)
Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(視圖),以便我的應用程序中的所有視圖都可以訪問?) - IT屋-程序員軟件開發技術
Having a single entry point to a website. Bad? Good? Non-issue?(有一個網站的單一入口點.壞的?好的?沒問題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務層在 Zend 或 PHP 中常見嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
主站蜘蛛池模板: 懂色av一区二区三区在线播放 | 成人一区二区三区在线观看 | 久久久久久999 | 欧美精品国产精品 | 欧美激情第一区 | 欧美黑人一级爽快片淫片高清 | 精品视频在线免费观看 | 性欧美精品一区二区三区在线播放 | 日韩中文字幕在线观看 | 美女二区 | 一区二区三区免费 | 久久亚洲欧美日韩精品专区 | 亚洲视频在线免费观看 | 国产成人一区二区三区精 | 欧美日韩在线精品 | 欧美日韩在线看 | 97精品国产 | 欧美夜夜 | 久久久久久久久久久久久9999 | 综合久久99 | 91一区二区三区在线观看 | 日韩一区不卡 | 国产精品久久久久久吹潮 | 91色视频在线观看 | 久久成人精品一区二区三区 | 亚洲国产精品99久久久久久久久 | 日韩美香港a一级毛片免费 国产综合av | 亚洲精品国产成人 | 一级欧美 | 亚洲综合99| 久久久久精 | 午夜在线视频一区二区三区 | 91国语清晰打电话对白 | 在线视频中文字幕 | 成人毛片一区二区三区 | 天天干天天玩天天操 | 国产a级黄色录像 | 丁香综合| 99这里只有精品视频 | 日韩精品一区二区三区中文在线 | 久久久精品国产 |