I am Creating a simple layout block and template, but it is giving error
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Test_Module::stock_left.phtml' in module: 'Test_Module' block's name: 'productleft'
layout catalog_product_view.xml
<?xml version="1.0"?>
<page layout = "1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<body>
<referenceContainer name="product.info.main">
<block class="Test\Module\Block\StockLeft" name="productleft" template="Test_Module::stock_left.phtml"/>
</referenceContainer>
</body>
</page>
Block StockLeft.php
<?php
namespace Test\Module\Block;
use Magento\Framework\view\Element\Template;
class StockLeft extends Template{
}
Template : stock_left.phtml
<?php
/**@var \Test\Module\Block\stockleft $blocks */
?>
<h1>hello world</h1>
Thanks in advance.