Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'MageArray_CreditMemoExtended::order/creditmemo/create/form.phtml' in module: 'Magento_Sales' block's name: 'form' 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