【问题标题】:SilverStripe Swipestripe - swipestripe-gallery module errorSilverStripe Swipestripe - swipestripe-gallery 模块错误
【发布时间】:2015-09-03 16:47:09
【问题描述】:

我已经安装了 Swipestripe 模块。并为产品图片添加了 swipestripe-gallery 模块。 当我执行 dev/bulid?flush=1 时,它显示错误 Class 'Gallery_PageExtension' 不存在 我在 swipestripe-gallery/_config 文件夹中看到了 gallery.yml 文件,其中有

Product:
   extensions: 
     - 'Gallery_PageExtension'

但该类不在 swipestripe-gallery/code 文件夹中的 Product.php 文件中。 在评论了上面的代码之后,我做了 dev/build?flush=1 并且没有错误。但是在产品页面中没有添加图库选项卡。 请帮忙。

【问题讨论】:

  • 嗯,Product 类可以在另一个模块中,没关系。您是否使用composer安装了它? Product.php 是否存在于 /swipestripe/code/ 中的任何位置?另外 - 再次刷新 ;) 表是在数据库中生成的吗? /dev/build/ 没有错误退出吗?请仔细检查。
  • @wmk 是的,我已经检查过了。问题是,如果有一个类,它将作为扩展添加。但是这个模块中没有名为“Gallery_PageExtension”的类。那么它应该如何添加为扩展名?如果存在上述代码,则 dev/build 不会无错误退出。

标签: silverstripe swipestripe


【解决方案1】:

您没有使用 composer 安装?你的错 ;) 它为你安装了所有要求,你可以快乐地编码。

请参阅 https://github.com/swipestripe/silverstripe-swipestripe-gallery#requirements,您需要安装 https://github.com/frankmullenger/silverstripe-gallery 才能在您的代码库中获取此图库扩展。

我强烈建议您使用 composer 安装所有模块。一开始可能会有点困难,但在某些日子你的生活会舒服得多! A good introduction can be found in the ss docs.

【讨论】:

  • 哦!我实际上并没有注意到这一点,因为我已经没有时间完成我的网站了。非常感谢。你节省了我的时间。是的,我没有使用作曲家。但肯定会从下次开始使用,这样我就不会陷入这种情况。现在一切正常。
【解决方案2】:

Swipestripe 的配置没有该代码:https://github.com/swipestripe/silverstripe-swipestripe/blob/2.1/_config/swipestripe.yaml

它的图库模块:https://github.com/swipestripe/silverstripe-swipestripe-gallery/blob/1.1/_config/gallery.yml

这是两个独立的模块。如果画廊文件如您所说的那样位于 swipestripe/_config 中,那么在我看来,安装并没有按预期进行。

安装根目录下应该有两个文件夹

  • 滑动条/
  • swipestripe-gallery/

与每个模块相关的所有文件都应位于每个(单独的)文件夹中。似乎您缺少 swipestripe-gallery 文件夹,这意味着该类实际上不存在(当您收到此错误时,只需检查该类是否存在于您的安装中的某个位置。使用 grep 是最简单的方法)。

【讨论】:

  • 对不起。我编辑了这个问题。是的,有两个模块。并且代码在 swipestripe-gallery/_config/gallery.yml 中。错误地我输入了 swipestripe 而不是 swipestripe-gallery
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多