Shared on Mage Dispatch · 10 Feb 2026
When Do Magento Block Classes Beat ViewModels?
When should you use a Block Class instead of a ViewModel in Magento? Most Magento developers default to ViewModels for adding PHP code to templates -- and that's usually right. But there's one situation where a custom Block Class is the better choice.