Magento 未定义常数



嗨,Magento有问题,因为它在我单击太阳镜菜单时向我显示此错误:

Notice: Use of undefined constant id - assumed 'id'  in /var/www/app/design/frontend/glassesonline/default/template/mana/filters/items/list.phtml on line 159

这是第 159 行的代码

<input id="category" type="hidden"  value="<?php $arr = $this->getRequest()->getParams(id,false); echo $arr['id']; ?>">

这让我发疯,请让我知道我错在哪里,如果需要,我会提供更多信息。谢谢

应该是:

<input id="category" type="hidden"  value="<?php $arr = $this->getRequest()->getParams('id',false); echo $arr['id']; ?>">
                                                                                        ^^^

你在这里缺少引号,PHP 认为你正在尝试使用你没有的已定义变量。始终对字符串使用引号。

最新更新