我正在尝试使用JMSSerializerBundle但运行后未列出该服务app/console container:debug | grep jms_serializer
$ app/console container:debug | grep jms_serializer
jms_serializer.json_deserialization_visitor container JMS\SerializerBundle\Serializer\JsonDeserializationVisit
jms_serializer.json_serialization_visitor container JMS\SerializerBundle\Serializer\JsonSerializationVisitor
jms_serializer.metadata.lazy_loading_driver container Metadata\Driver\LazyLoadingDriver
jms_serializer.metadata_driver container Metadata\Driver\DriverChain
jms_serializer.naming_strategy container JMS\SerializerBundle\Serializer\Naming\CacheNamingStrate
jms_serializer.xml_deserialization_visitor container JMS\SerializerBundle\Serializer\XmlDeserializationVisito
jms_serializer.xml_serialization_visitor container JMS\SerializerBundle\Serializer\XmlSerializationVisitor
jms_serializer.yaml_serialization_visitor container JMS\SerializerBundle\Serializer\YamlSerializationVisitor
安装后
composer require jms/serializer-bundle
并配置
// in AppKernel::registerBundles()
$bundles = array(
// ...
new JMS\SerializerBundle\JMSSerializerBundle($this),
// ...
);
如果你在某个地方使用
$this->get('jms_serializer')
我得到错误You have requested a non-existent service "jms_serializer".
我该如何解决?