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

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -