Попробуйте это в config.yml (спасибо pamil)
sylius_resource:
translation:
enabled: true
default_locale: "%locale%"
Я также необходимо добавить следующие конфиги:
sylius_product: ~
sylius_archetype:
resources:
product:
subject: Sylius\Component\Core\Model\Product
attribute: Sylius\Component\Product\Model\Attribute
option: Sylius\Component\Product\Model\Option
archetype:
classes:
model: Sylius\Component\Product\Model\Archetype
sylius_association:
resources:
product:
subject: %sylius.model.product.class%
association:
classes:
model: Sylius\Component\Product\Model\ProductAssociation
Использование sylius.yml для справки, когда в беде. Также обратите внимание, что sylius bundles need to be registered in specific order - Это легко упустить. В документах основное внимание уделяется доктрине, которая является последней, но порядок пакетов Силиуса не менее важен.
Вот мой AppKernel для справки:
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
new Sylius\Bundle\OmnipayBundle\SyliusOmnipayBundle(),
new Sylius\Bundle\MoneyBundle\SyliusMoneyBundle(),
new Sylius\Bundle\OrderBundle\SyliusOrderBundle(),
new Sylius\Bundle\PricingBundle\SyliusPricingBundle(),
new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
new Sylius\Bundle\AssociationBundle\SyliusAssociationBundle(),
new Sylius\Bundle\ArchetypeBundle\SyliusArchetypeBundle(),
new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
new Sylius\Bundle\VariationBundle\SyliusVariationBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AppBundle\AppBundle(),
new FOS\UserBundle\FOSUserBundle(),
);
Лучше не использовать sylius связки пока он находится в альфа-стадии. Даже если вы установите его успешно, некоторые функции не будут работать. По этой причине я бросил это несколько раз в своих проектах. –
Спасибо, да, в конце концов я сделал то же самое и решил просто написать собственное решение. – Kookas