【问题标题】:Get custom url in phtml file Magento 2在 phtml 文件 Magento 2 中获取自定义 url
【发布时间】:2020-10-30 06:47:02
【问题描述】:

我在帖子表中有帖子。 我需要在这样的 /id 页面上显示帖子,其中 id 是 post_id。 我可以从像 magento/5 这样的 id 获得帖子 在帖子页面上获取有关页面的数据,例如标题,文本,... 我是怎么做到的?

【问题讨论】:

    标签: php sql database magento magento2


    【解决方案1】:

    尝试在您的块类中创建一个 Post 模型工厂,您可以将 post_id 作为过滤器传递并能够获取您想要的其他数据

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-02
      • 1970-01-01
      • 2016-03-21
      • 2016-09-19
      • 1970-01-01
      • 2012-11-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多