Oct 19, 2021•6 min read
Magento 2 view models: ArgumentInterface, layout XML, and when to use them
Magento 2 view models let you inject logic into templates without overriding blocks. This guide covers ArgumentInterface, layout XML (name="view_model"), getViewModel(), and when a view model beats a block.
Read article