久久久久久久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 示例)
主站蜘蛛池模板: 欧美久操网 | 久久久久久久久久影视 | 久久久成人精品 | 精品国产一区二区三区久久久蜜月 | 久久久国产一区二区三区四区小说 | 久久国产综合 | 久久久久一区 | 韩日一区 | 天天看天天摸天天操 | 日一区二区| 国产成人精品a视频 | 一级片在线免费播放 | 亚洲一区中文 | 国产一区二区三区视频在线观看 | 一区二区三区在线 | 亚洲精品一区二区冲田杏梨 | 成人精品一区二区三区 | 成人在线免费电影 | 日韩欧美精品在线 | 国产传媒在线观看 | 亚洲一区二区在线视频 | 91.色| 国产福利91精品一区二区三区 | 91夜色在线观看 | 成人免费高清 | 中文在线视频 | 久久久国产一区 | 欧美综合一区二区 | 亚洲高清在线 | 可以在线看的黄色网址 | 蜜桃在线一区二区三区 | 精品一二三区 | 中文字幕国产精品 | 亚洲网址在线观看 | 免费骚视频 | 午夜亚洲| 在线欧美激情 | 亚洲视频在线观看免费 | 伊人久久大香线 | 国产精品成人一区二区三区夜夜夜 | 国产三级一区二区三区 |