正如标题所示,是否可以在一个控制器中更新多个模型?我正在使用Builder插件来处理事情。我可以看到,在创建控制器时,我们只能选择一个“基本模型”。我们怎么做?
也是一个问题。我可以看到你可以在表单中使用标签,但我从来没有使用过它们。当我考虑更新多个模型时,我认为它们可以用于此目的。
答案 0 :(得分:0)
实际上Builder
仅适用于kick-starting your plugin
或simpler plugin development
,
如果您需要some complex kind of stuff
,那么您需要 develop/edit files your self
,因为builder
可以不这样做(现在强>)。
对于多个模型
,您可以保留多个控制器personally i would say that will be the best practice
不同的情况:
但是但是如果您想要edit other model's data from same controller
并且他们relation to current model
currently editing
,那么我想我们可以使用relation-manager
来relational-field
将它们显示为显示list of related model's records
的{{1}},点击list-item
后,您将获得modal
和you can edit them there
。
另一种不同的情况:
可能如果不是这样那么您需要develop your own controller
您需要render
forms
和save
其数据手动即可。 (因为我们需要自定义解决方案)。
要开始定制并构建您的解决方案,这些Titorials将为您提供很多帮助。
MVC在10月份如何运作CMS: http://octobercms.com/support/article/ob-19
手动渲染列表和表单: http://octobercms.com/support/article/ob-20
实施嵌套关系: http://octobercms.com/support/article/ob-21
观看本教程后you can develop your own controller which can have
多个表单and
列出and you can
将数据保存在单个控制器中`。
信息说明(附带问题&答案):
他们是just tabs
普通标签,如果你有because
那就model with lot of fields
你可以分开他们类别明智强>
对于前:
客户模式