MVC求解释

AGR68117 2010-11-23 06:49:11
今天刚接触了MVC这个概念。现在还不是很明白。只知道它是讲业务层和视图层分开,可以实现一个数据模型,不同的视图表现形式。听起来是个不错的概念。就是实现起来不知道从何学起啊。
有高手可以举例吗?
我看到说可以实现从mysql到oracle的转换,也可以从html的数据转成flash的表现形式~~

迷茫ing
...全文
102 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
igaojie 2010-11-23
  • 打赏
  • 举报
回复

楼主知道的已经够多了··呵呵·~~基本思想就是这样
[Quote=引用楼主 agr68117 的回复:]
今天刚接触了MVC这个概念。现在还不是很明白。只知道它是讲业务层和视图层分开,可以实现一个数据模型,不同的视图表现形式。听起来是个不错的概念。就是实现起来不知道从何学起啊。
有高手可以举例吗?
我看到说可以实现从mysql到oracle的转换,也可以从html的数据转成flash的表现形式~~

迷茫ing
[/Quote]
heyli 2010-11-23
  • 打赏
  • 举报
回复
学的话php有很多开源框架的 如 codeigniter thinkphp zend framework yii 等
lazysmile 2010-11-23
  • 打赏
  • 举报
回复
http://lmgtfy.com/?q=MVC
君望永远 2010-11-23
  • 打赏
  • 举报
回复
Model 主要是数据库操作(比如接口IUserDao 实现类UserDaoMysql,UserDaoOracle)和商业可重用的Bean 一套接口 多种实现~
Controll 只要是负责调用Model 和进行页面跳转等控制
View 则是显示层~ 可以php 可以Flash或Silverlight
张小莱 2010-11-23
  • 打赏
  • 举报
回复
概念我就不多说了,专业术语我不太懂。我给你写一个最简单的MVC例子吧,就是从数据库中读取数据并传给模板的流程。

M:

class select() {
public function s($id) {
$sql = "select * from my_table where id='".$id."'";
$rs = mysql_fetch_array(mysql_query($sql));
return $rs;
}
}

V:

<html>
<head></head>
<body>
{$rr}
</body>
</html>


C:

class chaxun() {
public function abc() {
$id = $_POST["id"];
$db = new select();
$rr = $db->s($id);
$this->assign("rr",$rr);
$this->display();
}
}
An outstanding author team presents the ultimate Wrox guide to ASP.NET MVC 4 Microsoft insiders join giants of the software development community to offer this in-depth guide to ASP.NET MVC, an essential web development technology. Experienced .NET and ASP.NET developers will find all the important information they need to build dynamic, data-driven websites with ASP.NET and the newest release of Microsoft's Model-View-Controller technology. Featuring step-by-step guidance and lots of code samples, this guide gets you started and moves all the way to advanced topics, using plenty of examples. Designed to give experienced .NET and ASP.NET programmers everything needed to work with the newest version of MVC technology Expert author team includes Microsoft ASP.NET MVC insiders as well as leaders of the programming community Covers controllers, views, models, forms and HTML helpers, data annotation and validation, membership, authorization, security, and routing Includes essential topics such as Ajax and jQuery, NuGet, dependency injection, unit testing, extending MVC, and Razor Includes additional real-world coverage requested by readers of the previous edition as well as a new case study example chapter 下面是上一版书的中文介绍 《ASP.NET MVC 3 高级编程》主要内容是描述视图的概念,探讨Razor语法、NuGet、单元测试等,解释控制器在MVC框架中的作用,以及模型在绑定和数据访问策略中发挥的作用,演示如何显示和处理表单,涵盖添加到April 2011 Tools Update中的新特性,如基架和HTML5项目模板,展示在客户端和服务器端验证模型的过程给出利用成员资格、援权和安全特性的忠告,讲解将TDD应用于ASP.NET MVC的方法。

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧