0

This is my layout file where i need to call Viewmodel so that it can be used by block .

<referenceBlock name="product.info.review">
        <arguments>
            <argument name="view_model" xsi:type="object">Vendor\ModuleName\ViewModel\Test</argument>
        </arguments>
    </referenceBlock>
  • need to which magento version are you working as per tag you are looking solution for M2.1, please correct me if i wrong. XSI type object is not available in Magento 2.0 or 2.1. – Kanhaiya lal Aug 28 at 6:47
  • you can follow yireo.com/blog/2017-08-12-viewmodels-in-magento-2 – Sumit Aug 28 at 6:49
  • @Kanhaiyalal i am working on magento 2.3 – usman Aug 28 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.