为什么不赞成使用Joomla 3的JModelBase?应该使用什么代替呢?

问题描述 投票:0回答:1

Joomla 3引入了此处介绍的新MVC类Joomla MVC manual,但现在似乎已弃用了这些类(例如:JModelBase class docs),我无法弄清楚为Joomla 3开发MVC组件应实际使用的内容。 。应该使用哪些基类?

joomla joomla3.0
1个回答
0
投票
[如果您查看3.9.14版本中的一些核心Jooma 3.0扩展,它们将在横幅组件中使用以下内容:

站点:

    项目-JModelLegacy
  • 列表-JModelList
  • 管理员

      项目-JModelAdmin
  • 列表-JModelList
  • 但是,由于Joomla 4即将上市,并且较新版本的joomla 3支持它,因此我将使用新类:

    站点:

      项目-class <Component>Model<Section> extends \Joomla\CMS\MVC\Model\ItemModel
  • 表格-class <Component>Model<Section>Form extends \Joomla\CMS\MVC\Model\FormModel
  • 列表-class <Component>Model<Sections> extends \Joomla\CMS\MVC\Model\ListModel
  • 管理员:

      项目-class <Component>Model<Section> extends \Joomla\CMS\MVC\Model\AdminModel
  • 列表-class <Component>Model<Sections> extends \Joomla\CMS\MVC\Model\ListModel
  • 另请参阅Joomla 3 MVC component docs

    Joomla API Docs

  • © www.soinside.com 2019 - 2024. All rights reserved.