Octobercms可以在一个Controller中更新多个模型吗?

时间:2018-01-26 08:13:24

标签: octobercms octobercms-plugins octobercms-backend

正如标题所示,是否可以在一个控制器中更新多个模型?我正在使用Builder插件来处理事情。我可以看到,在创建控制器时,我们只能选择一个“基本模型”。我们怎么做?

也是一个问题。我可以看到你可以在表单中使用标签,但我从来没有使用过它们。当我考虑更新多个模型时,我认为它们可以用于此目的。

1 个答案:

答案 0 :(得分:0)

实际上Builder仅适用于kick-starting your pluginsimpler 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-managerrelational-field将它们显示为显示list of related model's records的{​​{1}},点击list-item后,您将获得modalyou can edit them there

另一种不同的情况:

可能如果不是这样那么您需要develop your own controller您需要render formssave其数据手动即可。 (因为我们需要自定义解决方案)。

  

要开始定制并构建您的解决方案,这些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你可以分开他们类别明智

对于前:
客户模式

  • 个人详细信息可以达到顶级水平
  • 驻留地址和公司地址可以在地址标签
  • 中找到
  • 联系方式可以在联系标签
  • 中找到
  • 社交细节可以进入社交标签等。