I am using Magento2.4. In my phtml template, I am trying to escape an a argument that is being passed into a javascript file via requireJS, but PhpStorm is warning me that escapeJs() is depreciated. What would be the correct function to use if escapeJs() is depreciated?
1 Answer
In the block has $escaper already, you need to use that. Here is the example:
<?php
/**
* @var \Magento\Framework\Escaper $escaper
*/
?>
Now you can use:
$escaper->escapeJs()