Twig 在细枝文件Opencart 3.0.2.0中显示来自控制器的数据
我已经将这一行添加到catalog/controller/product/category.phpTwig 在细枝文件Opencart 3.0.2.0中显示来自控制器的数据,twig,opencart,opencart-3,Twig,Opencart,Opencart 3,我已经将这一行添加到catalog/controller/product/category.php $data['string1'] = "string 1"; 以前 $this->response->setOutput($this->load->view('product/category', $data)); 在catalog/view/theme/journal2/template/product/category.twig中 取代 <h4 class=
$data['string1'] = "string 1";
以前
$this->response->setOutput($this->load->view('product/category', $data));
在catalog/view/theme/journal2/template/product/category.twig中
取代
<h4 class="name"><a href="{{ product.href }}">{{ product.name }} </a></h4>
用这条线
<h4 class="name"><a href="{{ product.href }}">{{ product.name }} {{ string1 }} </a></h4>
但它什么也没显示,我错过了什么
提前谢谢。我已经解决了,忘记刷新修改了。这就是问题所在。
扩展->修改->刷新。清除缓存了吗?日记缓存,ocmod缓存,twig缓存?我试图直接在.twig文件中打印tt,它打印了它,我不认为这是cahce问题我这样做的,它打印了tt,你确定category.php没有被缓存吗?嗯,我没有检查,我会检查它,