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

Laravel 3:尋找如何使用模型的解釋

Laravel 3 : Looking for explanation how to use the model(Laravel 3:尋找如何使用模型的解釋)
本文介紹了Laravel 3:尋找如何使用模型的解釋的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我是 MVC 的新手,我的第一個框架是 Laravel(現在是 3 個).我已經開始專門在路由中編碼,然后我轉向了控制器.但是,我正在控制器中執行所有數據庫操作.我不明白如何使用模型.

示例要么演示控制器中或路由中的所有內容,但它們從未拆分模型、控制器和視圖.

誰能告訴我如何使用該模型?簡而言之,我不明白如何將它們相互鏈接,例如將表單輸入發送到它們的模型,或將處理后的數據發送回控制器.

具有完整 MVC 設置的 Laravel(如果可能,v3)的 github 存儲庫也可以很好地分析,如果有人有一個給我看?

謝謝.

解決方案

我聽過的關于框架主題的最佳陳述歸功于鮑勃叔叔:

<塊引用>

好的架構可以推遲重大決策!

特別是:

  • 好的架構會延遲選擇框架!

另一個值得思考的偉大作品:

<塊引用>

MVC 不是架構!這是一種交付設計模式.

觀看他的視頻 - 可悲的是,它是為數不多的沒有花 1000 字來說明 10 中可以說的內容的視頻之一,我不能高度推薦它 - 它會幫助您理解很多要點在您的問題中提出:

Robert C Martin(鮑勃叔叔) - 清潔建筑和設計 - 視頻>

當然,他的《Clean Code》一書也值得推薦!

I'm new at MVC and my first framework is Laravel (3 for now). I've started coding exclusively in the routes, and I moved to the controller. I'm however doing all of my database operations in the controller. I do not understand how to use the model.

Examples either demonstrate everything in the controller or in the route, but they never split the model, controller and view.

Could anyone kindly explain me how to use the model? In short I don't understand how to link one to each other, like sending form input to them model, or processed data back to the controller.

A github repo of a Laravel (v3 if possible) with a full MVC setup would be nice to analyze too, if anyone has one up for me to look at?

Thanks.

解決方案

The best statement on the subject of Frameworks I've heard is due to Uncle Bob:

A good Architecture allows major decisions to be deferred!

Specifically:

  • A good Architecture delays choosing a Framework!

Another great piece to think about:

MVC is not an Architecture! It is a Delivery Design Pattern.

Watch his video - it is one of the sadly few ones out there that don't spend 1000 words on what can be said in 10 and I can't highly enough recommend it - and it will help you to understand many points raised in your question:

Robert C Martin(Uncle Bob) -Clean Architecture and Design - Video

Of course, his book on Clean Code is also highly recommended!

這篇關于Laravel 3:尋找如何使用模型的解釋的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 示例)
主站蜘蛛池模板: 午夜精品一区二区三区在线视频 | 草草草网站 | 欧洲一区二区视频 | 国产99久久久国产精品 | 韩日一区二区 | 在线国产一区二区 | 亚洲视频一区在线观看 | 中国一级特黄真人毛片 | 黄色大片网站 | 久久久久国产精品 | 久久久久一区 | 欧美久久一级特黄毛片 | 特黄色毛片 | 国产精品日女人 | 成人福利网站 | 天天插天天舔 | 日韩在线资源 | 97精品国产97久久久久久免费 | 亚洲色图插插插 | 中文字幕在线观看视频一区 | 亚洲国产精品区 | 欧美日韩国产一区二区三区 | 男女深夜网站 | 国产精品久久久久久吹潮 | 国产伦精品一区二区三区视频金莲 | 欧美成年网站 | 欧美在线精品一区 | 国产99久久精品一区二区永久免费 | 羞羞视频在线观看 | 91久久精品一区二区二区 | 久久亚洲一区二区三区四区 | 日韩精品一区二区在线观看 | 亚洲国产成人在线 | 日本免费一区二区三区 | 午夜精品91 | 亚洲国产黄色av | 久色激情 | av黄色在线 | 日韩中文在线 | 久久久婷| 在线国产99 |