A question on using $this->helper(...)
in phtml files:
- It returns something like this:
ObjectManager->get(...) (Singleton)
- I'm aware it's bad practice to use Object Manager phtml, but technically it's not using Object Manager directly.
Does this make it okay to use?
After doing some research I see:
Object manager should be used only in factories and then as injected in a constructor. The advantage of using this is less code to write. But this does not make it OK. The fact that this is still used in the core, is because it didn't get refactored yet. I hope it will be.
This is in response to using \Magento\Framework\App\ObjectManager::getInstance()
specifically mind you. For $this->helper()
it appears to be more unclear. Magento does still appear to use this in it's core.