Skip to content

Commit 71e5e05

Browse files
authored
Update 2. Determine how to use blocks.md
1 parent 3e01541 commit 71e5e05

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

3. Customizing the Magento UI/2. Determine how to use blocks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ In template, access your model instead of the block:
113113

114114
```php
115115
$viewModel = $block->getData('viewModel');
116+
// or
117+
$viewModel = $block->getViewModel();
116118
```
117119

118120
[ViewModels in Magento 2](https://www.yireo.com/blog/1856-viewmodels-in-magento-2)

0 commit comments

Comments
 (0)