I have a ViewModel class. I am getting a warning for my magento module "Please do not initialize JS component in php. Do it in template". Could someone help me out?
File: xxx/xxx/xx/xxx/xx/trackScript.phtml
<?php
/** @var xxx\xxxx\xxx\DataViewModel $helper */
?>
<script type="text/x-magento-init">
{
"*": {
"trackScript": {
"domain": "<?= $helper->getDomain(); ?>"
}
}
}
</script>
source https://stackoverflow.com/questions/70025461/magento-module-shows-warning-please-do-not-initialize-js-component-in-php-do-i
No comments:
Post a Comment