Home > Backend Development > PHP Tutorial > PHP MVC框架,该怎么处理

PHP MVC框架,该怎么处理

WBOY
Release: 2016-06-13 10:00:18
Original
937 people have browsed it

PHP MVC框架
大家好!我最近在学习PHP MVC ,请问大家,model起着什么作用? MVC才接触,学起来有点模糊,请大家帮帮忙了!

------解决方案--------------------
0.消灭零回答,造福人类。
1.model起着业务逻辑的作用.
2.controler起着全局控制的使用,用来调用业务逻辑model,并将调用的结果传递给view,最终展示给用户。
3.view起显示的作用,一般用模板。



class MyModel
{
funcation Logic()
{
//业务逻辑部分,如求1+2等于几。
echo 1+2;
 }
}

controler里new一个model并调用Logic这个业务逻辑,再将结果$result传给view就行了。

------解决方案--------------------
QeePHP API官方参考手册
http://qeephp.com/docs/qeephp-api

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template