Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento2 如何将图像添加到magento 2中的模块_Magento2 - Fatal编程技术网

Magento2 如何将图像添加到magento 2中的模块

Magento2 如何将图像添加到magento 2中的模块,magento2,Magento2,我已经创建了一个简单的hello world模块,有人能告诉我如何在hello world下面添加一个图像吗 我需要添加图像到phtml文件 phtml文件如下 请尝试下面的代码 getViewFileUrl('Test_HelloWorld::images/demo.jpg');?>“/>请尝试以下代码 getViewFileUrl('Test_HelloWorld::images/demo.jpg');?>“/>请编辑您的问题以包含代码的相关部分I edit您现在可以给我一个解决方案吗先生请

我已经创建了一个简单的hello world模块,有人能告诉我如何在hello world下面添加一个图像吗

我需要添加图像到phtml文件

phtml文件如下


请尝试下面的代码


getViewFileUrl('Test_HelloWorld::images/demo.jpg');?>“/>

请尝试以下代码


getViewFileUrl('Test_HelloWorld::images/demo.jpg');?>“/>

请编辑您的问题以包含代码的相关部分I edit您现在可以给我一个解决方案吗先生请编辑您的问题以包含代码的相关部分I edit您现在可以给我一个解决方案吗先生
<h2>Hello World></h2>
<img src = "<?php echo $block->getViewFileUrl('images/demo.jpg')"
app/code/Test/HelloWorld/view/frontend/web/images