Most of us are trying to install magento2.3 on windows xampp to learn magento or to work on it but unfortunately facing issues like
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file
I have wasted my days and days fixing and fighting with this issue. I left at one time working on installing magent2 on windows and started thinking of installing docker on my machine windows 10. Unfortunately installing docker on windows 10 home is another war and not easy. I have published another article on this “How to install docker on windows 10 Home”.

After struggling for many days, I came to know that this is not magento issue. This issue is related to windows “Directory Separator”. Finally, I figured out a way to fix this. For me, the solution worked is by going to the file \vendor\magento\framework\View\Element\Template\File\Validator.php and replacing the below function definition as below:
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;
}
