Вопрос

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]
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top