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.

Visit link → https://youtube.com/watch?v=xlWLggQz0WU&si=OU-I15BZIYnNXfuY

More like this

New here? This is Mage Dispatch

Mage Dispatch is a community-run archive and bi-weekly newsletter for the Magento, Adobe Commerce and Mage-OS ecosystem. Modules, articles, security advisories and tools, hand-picked by developers and shared so good work does not disappear into the void.

Browse the latest links → Explore by topic → Submit a link → About us →