inject it into the service like this
your.service:
class: Path\To\Your\Service
arguments: [@validator]
题
I am new in symfony, and I see in the documents, that I can get and use validator service in the controller like:
$this->get('validator');
what is the right\easy way to get the validator service in my own service class that i wrote
thank you
解决方案
inject it into the service like this
your.service:
class: Path\To\Your\Service
arguments: [@validator]