I create a file custom block php.
Directory is: app\design\frontend\Vendor\default\Magento_Theme\Block\CustomBlock.php
CustomBlock.php:
class CustomBlock extends \Magento\Framework\View\Element\Template
{
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Store\Model\Information $storeInfo,
array $data = []
)
{
$this->_storeInfo = $storeInfo;
parent::__construct($context, $data);
}
}
Define block xml:
<block class="Magento\Theme\Block\CustomBlock" name="...">
<argument name="template" xsi:type="string">Magento_Theme::html/footer/footer.phtml</argument>
</block>
But I get an exception:
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Magento\Theme\Block\CustomBlock
Exception #1 (ReflectionException): Class Magento\Theme\Block\CustomBlockdoes not exist
Please help me!