Video Lesson: Call a ViewModel function from a template in Magento

Call a ViewModel function from a template in Magento

This is premium content

Only available to enrolled or University students.
Join today to unlock all lessons in this course.

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...

Premium content

Enroll to unlock the full content and all course materials.

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Enroll in this course for AI tutor access.

Comments

Join the discussion!

Notes

Keep track of what you learn!