Call a ViewModel function from a template in Magento
Learn how to pass a ViewModel to a template so its functions can be called during rendering.
Lesson Content
In order to access our ViewModel from a template file, we need to actually pass it in as an argument to the related block. We’ll do this by going back to where the phone number block was created, whic...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.