我试图将Sylius Product Bundle安装到我新的Symfony项目中。 我一步一步地遵循安装文档,仍然收到此错误:
InvalidArgumentException in DoctrineTargetEntitiesResolver.php line 91:
The class sylius.model.product_variant.class does not exist.
作曲家之后我的composer.json需要sylius / product-bundle
{
...,
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"sylius/product-bundle": "^0.15.0"
},
...
}
AppKernel.php
$bundles = array(
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
...
config.yml
sylius_product:
driver: doctrine/orm # Configure the doctrine orm driver used in the documentation.
stof_doctrine_extensions:
orm:
default:
sluggable: true
timestampable: true
的routing.yml
app:
resource: "@AppBundle/Controller/"
type: annotation
sylius_product:
resource: "@SyliusProductBundle/Resources/config/routing.yml"
任何想法如何绕过这个问题?
更新 如果我将0.19.0版本错误更改安装到:
ServiceNotFoundException in ContainerBuilder.php line 816:
You have requested a non-existent service "sylius.factory.product_variant".