Skip to content

How to use other classes object in .phtml file without object manager in magento 2

I am currently invoking the method “xyz” using the objectmanager, however the object manager should not be used in phtml file as mentioned in the Magento 2 documentation. What is the best practice way to create an object of other classes?