-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix set and get view model method code #8494
Conversation
Hi @pawan, thank you for your contribution! |
Adobe CLA sign |
@@ -139,3 +139,5 @@ $postArray = $viewModel->getPostData( | |||
['product' => $_item->getEntityId()] | |||
); | |||
``` | |||
{:.bs-callout-info} | |||
If you use `argument name="view_model"` you can access it using `$viewModel = $block->getViewModel();` Or You can use `argument name="viewModel"` and can access `$viewModel = $block->getData('viewModel');` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IF this is true then the to changes above are mutually exclusive - only one of them should have been changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, It depends on implementation! either we can use Getter/Setter OR we can get Data of argument!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BarnyShergold First change I made as per example and second change is from actual changes from file https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml#L178
Hi @pawan, thank you for your contribution! |
@BarnyShergold OK, why it is showing 2 closed pull request at https://opensource.magento.com/profile/pawan/contribution_statistic |
Purpose of this pull request
This pull request (PR) is fix for issue #8493
Affected DevDocs pages