@dmitry how to use this in my custom phtml file ?
Method 1
Using the object manager. It is shorter, and I prefer this way.
How to get a singleton with the object manager?
Method 2
Using constructor injection for the corresponding block class.
Magento 2 core prefers this way.
http://devdocs.magento.com/guides/v2.0/extension-dev-guide/depend-inj.html#dep-inj-preview-cons