我正试图将Sylius产品束集成到我现有的Symfony项目中。它已经配置了理论。
这是我正在犯的错误:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "driver" at path "sylius_attribute" must be configured. 知道是什么导致的吗?我一开始就按照指示行事,没有做任何其他的梅毒装置。
http://docs.sylius.org/en/latest/bundles/SyliusProductBundle/installation.html
我必须更改我的composer.json文件中的理论包版本,以便允许
作曲家需要“sylius/product”
成功地运行而没有错误。我将版本从1.2.*更改为
“学说/学说-捆绑”:"1.3.*“
在composer安装了这些家伙之后,我在我的config.yml文件中添加了以下内容
sylius_product:
driver: doctrine/orm
classes:
product:
model: Sylius\Bundle\CoreBundle\Model\Product
controller: Sylius\Bundle\CoreBundle\Controller\ProductController
repository: Sylius\Bundle\CoreBundle\Repository\ProductRepository
stof_doctrine_extensions:
default_locale: es_us
translation_fallback: true
orm:
default:
tree: true最初,我得到了以下错误:
[Exception]
Missing parameter sylius.translation.default.mapping. Default translation mapping must be defined! 在搜索了一下之后,我将下面的部分添加到config.yml文件中
sylius_translation:
default_mapping:
translatable:
field: translations
currentLocale: currentLocale
fallbackLocale: fallbackLocale
translation:
field: translatable
locale: locale在前面的config.yml文件中已经存在如下内容:
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true在这种情况下我什么都没改变。
我在这里做错了什么或者失踪了什么?我们将非常感谢ANy的帮助。
谢谢!
编辑
我试着添加以下所有内容:
sylius_attribute:
driver: doctrine/orm
sylius_variation:
driver: doctrine/orm
sylius_archetype:
driver: doctrine/orm现在,我得到以下错误:
[InvalidArgumentException]
The class sylius.model.product_archetype.class does not exist. 我添加了相应的文件到AppKernel,仍然没有运气!
new Sylius\Bundle\AttributeBundle\SyliusArchetypeBundle(),然后改为:
new Sylius\Bundle\ArchetypeBundle\SyliusArchetypeBundle(),到目前为止,设置Sylius一直很安静,压力很大
发布于 2015-02-26 00:26:27
发布于 2015-02-28 23:04:05
我有更新文档的ProductBundle:
在composer.json中,您需要添加以下行:
"require": {
...
"sylius/locale-bundle": "0.13.*",
"sylius/product-bundle": "0.13.*"
...
}在app/AppKernel.php中
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new Sylius\Bundle\ArchetypeBundle\SyliusArchetypeBundle(),
new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
new Sylius\Bundle\LocaleBundle\SyliusLocaleBundle(),
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
new Sylius\Bundle\TranslationBundle\SyliusTranslationBundle(),
new Sylius\Bundle\VariationBundle\SyliusVariationBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),在config.yml中
parameters:
sylius.locale: "%locale%"
sylius_archetype:
classes:
product:
subject: Sylius\Component\Product\Model\Product
attribute: Sylius\Component\Product\Model\Attribute
option: Sylius\Component\Product\Model\Option
archetype:
model: Sylius\Component\Product\Model\Archetype
repository: Sylius\Bundle\ResourceBundle\Doctrine\ORM\TranslatableEntityRepository
translatable:
targetEntity: Sylius\Component\Product\Model\ArchetypeTranslation
archetype_translation:
model: Sylius\Component\Product\Model\ArchetypeTranslation
sylius_attribute:
driver: doctrine/orm
sylius_product:
driver: doctrine/orm
sylius_locale:
driver: doctrine/orm
sylius_translation:
default_mapping:
translatable:
field: translations
currentLocale: currentLocale
fallbackLocale: fallbackLocale
translation:
field: translatable
locale: locale
sylius_variation:
driver: doctrine/orm
stof_doctrine_extensions:
orm:
default:
sluggable: true
timestampable: true现在,您应该能够成功地运行模式更新。
$ php app/console doctrine:schema:update --dump-sql如果满意,执行:
$ php app/console doctrine:schema:update --force更新:升级到0.14 (当前发布的版本为0.13)时,此配置将中断。
https://stackoverflow.com/questions/28731801
复制相似问题