The Model represents your data structures.
w模型代表数据结构。
https://www.codeigniter.com/userguide3/overview/mvc.html
http://codeigniter.org.cn/user_guide/overview/mvc.html
Model-View-Controller
CodeIgniter is based on the Model-View-Controller development pattern. MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.
- The Model represents your data structures. Typically your model classes will contain functions that help you retrieve, insert, and update information in your database.
- The View is the information that is being presented to a user. A View will normally be a web page, but in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of “page”.
- The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
CodeIgniter has a fairly loose approach to MVC since Models are not required. If you don’t need the added separation, or find that maintaining models requires more complexity than you want, you can ignore them and build your application minimally using Controllers and Views. CodeIgniter also enables you to incorporate your own existing scripts, or even develop core libraries for the system, enabling you to work in a way that makes the most sense to you.
模型-视图-控制器
CodeIgniter 的开发基于 MVC(模型-视图-控制器)设计模式。MVC 是一种 用于将应用程序的逻辑层和表现层分离出来的软件方法。在实践中,由于这种分离 所以你的页面中只包含很少的 PHP 脚本。
- 模型 代表你的数据结构。通常来说,模型类将包含帮助你对数据库进行增删改查的方法。
- 视图 是要展现给用户的信息。一个视图通常就是一个网页,但是在 CodeIgniter 中, 一个视图也可以是一部分页面(例如页头、页尾),它也可以是一个 RSS 页面, 或其他任何类型的页面。
- 控制器 是模型、视图以及其他任何处理 HTTP 请求所必须的资源之间的中介,并生成网页。
CodeIgniter 在 MVC 使用上非常宽松,因为模型不是必需的。如果你不需要使用模型这一层,或是 认为维护模型比你想象中的复杂很多,那么你可以忽略它,而只使用控制器和视图创建你的应用程序。 CodeIgniter 可以让你直接调用你现有的脚本,甚至你也可以为系统开发核心类,总之, CodeIgniter 让你以你感觉最舒适的方式进行开发。
The Model represents your data structures.的更多相关文章
- Persistent Data Structures
原文链接:http://www.codeproject.com/Articles/9680/Persistent-Data-Structures Introduction When you hear ...
- CSC 172 (Data Structures and Algorithms)
Project #3 (STREET MAPPING)CSC 172 (Data Structures and Algorithms), Spring 2019,University of Roche ...
- Algorithms & Data structures in C++& GO ( Lock Free Queue)
https://github.com/xtaci/algorithms //已实现 ( Implemented ): Array shuffle https://github.com/xtaci/al ...
- [轉]Linux Data Structures
Table of Contents, Show Frames, No Frames Chapter 15 Linux Data Structures This appendix lists the m ...
- A library of generic data structures
A library of generic data structures including a list, array, hashtable, deque etc.. https://github. ...
- The Swiss Army Knife of Data Structures … in C#
"I worked up a full implementation as well but I decided that it was too complicated to post in ...
- 剪短的python数据结构和算法的书《Data Structures and Algorithms Using Python》
按书上练习完,就可以知道日常的用处啦 #!/usr/bin/env python # -*- coding: utf-8 -*- # learn <<Problem Solving wit ...
- Go Data Structures: Interfaces
refer:http://research.swtch.com/interfaces Go Data Structures: Interfaces Posted on Tuesday, Decembe ...
- Choose Concurrency-Friendly Data Structures
What is a high-performance data structure? To answer that question, we're used to applying normal co ...
随机推荐
- # mysqlbinlog mysql-bin.000004 mysqlbinlog: unknown variable 'default-character-set=utf8'
# mysqlbinlog mysql-bin.000004 mysqlbinlog: unknown variable 'default-character-set=utf8' 加上--no-def ...
- pycharm编写spark程序,导入pyspark包
一种方法: File --> Default Setting --> 选中Project Interpreter中的一个python版本-->点击右边锯齿形图标(设置)-->选 ...
- linux udhcpc 后无法自动设置网卡ip
arm 主板用 udhcpc 获取租赁的空闲的ip后,并没有直接设置在网卡上. 查了一下相关原因,是因为虽然已经获取了ip, 但是并没有通过脚本去设置这个IP. 在 busybox 里面有相关的脚本要 ...
- 简单实现Spring中BeanFactory原理
上一篇文章介绍了Java反射机制在Spring IOC中的应用,知道了BeanFactory底层的实现原理. 原理搞懂了,对Spring IOC理解起来也很容易. 先来看看Java代码获取Spring ...
- Windows 使用 Gitblit 搭建 Git 服务器
吐槽 Windows 安装 Git 那真是各种问题层出不穷,试过N种方法,反反复复不知道装了多少遍,然后又卸载.最后使用了Gitblit搭建Git服务器,虽然也遇到一些问题,但是都解决了.这个软件其实 ...
- jquery库实现iframe自适应内容高度和宽度
javascript原生和jquery库实现iframe自适应内容高度和宽度---推荐使用jQuery的代码! <iframe src="index.php" id=&qu ...
- MapReduce的InputFormat过程的学习
转自:http://blog.csdn.net/androidlushangderen/article/details/41114259 昨天经过几个小时的学习,把MapReduce的第一个阶段的过程 ...
- qtcreator 中文乱码
qt输入法不能用,ui中不能显示中文,开发板不能显示中文,这几个一直困扰这我,网上查找资料,在代码中添加各种支持,都没有解决问题.今天刚好解决了,记录于此. 参考链接 http://blog.163. ...
- MTP(Media Transfer Protocol(媒体传输协议))简介
---恢复内容开始--- 1,简单说明 MTP,微软公司规定的新的传输规则(字面本来应该是协议的,但是自己感觉更像是规则,制定了基本上的所有路线,剩下的是你想怎么选择罢了,使用者完全没有可能在它的框架 ...
- JavaScript的arguements
---恢复内容开始--- arguments 对象 在函数代码中,使用特殊对象 arguments,开发者无需明确指出参数名,就能访问它们. 例如,在函数 sayHi() 中,第一个参数是 messa ...