Answers for "view model"

1

view model

use Magento\Framework\View\Element\Block\ArgumentInterface;

class ProductViewModel implements ArgumentInterface
{
    //...
}
Posted by: Guest on September-21-2021
1

view model

<?xml version="1.0"?>
<page>
    <body>
        <referenceBlock name="block.name">
            <arguments>
                <argument 
                    name="view_model" 
                    xsi:type="object">MageMastery\ViewModelExample\ViewModel\ProductViewModel</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>
Posted by: Guest on September-21-2021
-2

how to use by viewModels()

compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
Posted by: Guest on April-20-2020

Code answers related to "view model"

Browse Popular Code Answers by Language