1 exception(s): Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'C:/Users/stage/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js' code example

Example: Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file:

> protected function isPathInDirectories($path, $directories) {
>     if (!is_array($directories)) {
>         $directories = (array)$directories;
>     }
>     $realPath = $this->fileDriver->getRealPath($path);
>     $realPath = str_replace('\\', '/', $realPath); // extra code added
>     foreach ($directories as $directory) {
>         if (0 === strpos($realPath, $directory)) {
>             return true;
>         }
>     }
>     return false; }

Tags:

Php Example