正如标题所暗示的,是否可以在一个控制器中更新多个模型?我正在使用 Builder Plugin 来处理事情。正如我所见,当我创建控制器时,我们只能选择一个“基本模型”。我们该怎么做呢?
也是一个侧面问题。我可以看到您可以在表单中使用一些选项卡,但我从来没有使用过它们。当我考虑更新多个模型时,我正在使用选项卡,认为它们可能用于此目的。
正如标题所暗示的,是否可以在一个控制器中更新多个模型?我正在使用 Builder Plugin 来处理事情。正如我所见,当我创建控制器时,我们只能选择一个“基本模型”。我们该怎么做呢?
也是一个侧面问题。我可以看到您可以在表单中使用一些选项卡,但我从来没有使用过它们。当我考虑更新多个模型时,我正在使用选项卡,认为它们可能用于此目的。
实际上Builder
只是为了kick-starting your plugin
or 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
,然后单击list-item
您将获得modal
and you can edit them there
。
另一个不同的场景:
可能如果不是这种情况,那么您需要手动develop your own controller
获取render
您的数据forms
及其save
数据。(因为我们需要定制的解决方案)。
要开始定制并构建您的解决方案,此教程将对您有很大帮助。
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
你可以将它们按类别分开。
例如:
客户模型