Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以说我为主菜单“页面”制作了一个控制器,MainMenu 是直接由标签和按钮等单独的视图元素组成,还是会引用诸如 MainMenuView 之类的具有这些元素的类?还是只是将事件发送到事件系统以与视图进行通信?或者是其他东西?
按钮和标签很可能位于 中View,尽管标签可能来自Controller. 通常 aView只是 html 脚手架,其中View包含的数据Model由Controller. 所以对于一个主菜单,它可能只是到其他部分的链接和标签,所以可能不会有Model它,Controller只会返回View.
View
Controller
Model
所以如果有人去SomeMVCSite.com/home/index,Index Action就会被叫进来Home Controller。将Home Controller根据 a 从数据库中检索数据Model并返回View+ 数据。
SomeMVCSite.com/home/index
Index Action
Home Controller