symfony2.4 - symfony2 use global validator service in my own service -


I'm new to Symphony, and I see in documents that I can get validator service in the controller and use it I can:

  $ this-> Receive ('validator');  

What is the correct way to get a valid service in my own service class?

Thanks

< Div class = "post-text" itemprop = "text">

Put it in service like this

  your.service: class: path \ to \ your \ service arguments: [ @validator]  

Comments

Popular posts from this blog

scala - Play Framework - how to bind form to a session field -

Django Celery - running scheduled tasks -

perl - 'Unquoted string ".." may clash with future reserved word' but only when package is used -