Magento2 magento 2简单块触发异常无效模板文件

Magento2 magento 2简单块触发异常无效模板文件,magento2,Magento2,我是magento 2的新手,我想在标题中添加一些简单的html,但我无法开始工作,我有一个简单的主题覆盖magento中的空白主题,我创建了文件夹magento_主题,还有这个简单的default.xml <?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <p

我是magento 2的新手,我想在标题中添加一些简单的html,但我无法开始工作,我有一个简单的主题覆盖magento中的空白主题,我创建了文件夹magento_主题,还有这个简单的default.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configration.xsd">
  <referenceContainer name="header.panel"> <!-- the name of the container you want to insert into -->
    <container name="new_container" htmlClass="container_css_class" htmlTag="div">
      <block class="Magento\Framework\View\Element\Template" template="Magento_Theme::template/template.phtml" name="block_name" />
    </container>
  </referenceContainer>
</page>

我在使用magento 2.2.5时发现错误magento_主题::是templates文件夹的路径,当我更改文件夹templates的my template.phtml并将magento_主题::template/template.php更改为magento_主题::template.php时,我发现错误magento_主题::是templates文件夹的路径,当我更改文件夹模板的template.phtml,并将Magento_-theme::template/template.php更改为Magento_-theme::template.php。它起作用了

尝试将文件夹“template”重命名为“templates”(添加“s”),并使其如下所示


template=“Magento_Theme::template.phtml”

尝试将文件夹“template”重命名为“templates”(添加“s”),并使其如下所示


template=“Magento\u Theme::template.phtml”

啊,这已经让我好几次了!啊,这已经让我好几次了!
<div class="block" style="float: right;">
 <?php echo __('Custom Line'); ?>
</div>
1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid 
template file: 'Magento_Theme::template/template.phtml' in module: '' 
block's name: 'block_name'