问题
I just created a bundle (successfully), and when I am about to create an entity via console this happened(also with clear:cache):
[LogicException]
"enable_annotations" on the validator cannot be set as Annotations support is disabled.
mi config.yml looks like
framework:
validation: { enable_annotations: true }
serializer: { enable_annotations: true }
when i comment the options for validation throws the same Exception but with the serializer
when i comment both then it becomes a ServiceNotFoundException
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] The service "routing.loader" has a dependency on a non-existent service "an notation_reader".
What is the problem, I am using symfony 3.3.11
回答1:
You also need to enable annotation support in general. This happens automatically as soon as the Doctrine\Common\Annotations\Annotation
class is present. For this, you need to make sure to install the doctrine/annotations
package.
来源:https://stackoverflow.com/questions/47290778/enable-annotations-on-the-validator-cannot-be-set-as-annotations-support-is-dis