gpt4 book ai didi

magento - 我在管理面板 magento 中添加菜单时遇到问题

转载 作者:行者123 更新时间:2023-12-02 01:28:13 25 4
gpt4 key购买 nike

我创建了一个文件来添加我的模块:[ File as- Axovel_MenuItem.xml]

<?xml version="1.0"?>
<config>
<modules>
<Axovel_MenuItem>
<active>true</active>
<codePool>local</codePool>
</Axovel_MenuItem>
</modules>
</config>

在文件夹 app/etc/modules/中

然后我做了一个配置文件(config.xml)作为

<?xml version="1.0"?>
<config>
<modules>
<Axovel_MenuItem>
<version>0.1.0</version>
</Axovel_MenuItem>
</modules>
<global>
<helpers>
<menuitem>
<class>Axovel_MenuItem_Helper</class>
</menuitem>
</helpers>
</global>
<frontend>
<routers>
<menuitem>
<routeurfrontend>
<use>standard</use>
<args>
<module>Axovel_MenuItem</module>
<frontName>menuitem</frontName>
</args>
</routeurfrontend>
</menuitem>
</routers>
</frontend>
<adminhtml>
<layout>
<updates>
<menuitem>
<file>menuitem.xml</file>
</menuitem>
</updates>
</layout>
<acl>
<resources>
<admin>
<children>
<menuitem>
<title>Awesome Menu Item</title>
<children>
<sub_menu1>
<title>Example Menu Item</title>
</sub_menu1>
</children>
</menuitem>
</children>
</admin>
</resources>
</acl>
</adminhtml>
</config>

在文件夹 app/code/local/Axovel/MenuItem/etc/

然后我制作了一个 Adminhtml 配置文件 (adminhtml.xml) 作为

<?xml version="1.0"?>

<config>
<menu>
<menuitem>
<title>Awesome Menu Item</title>
<sort_order>20</sort_order>
<children>
<sub_menu1>
<title>Example Menu Item</title>
<sort_order>0</sort_order>
<!-- <action>menuitem/index/index</action> -->
</sub_menu1>
</children>
</menuitem>
</menu>
</config>

在文件夹 app/code/local/Axovel/MenuItem/etc/

并制作了一个辅助文件(Data.php)作为:

<?php
class Axovel_MenuItem_Helper_Data extends Mage_Core_Helper_Abstract
{
}
?>

在文件夹 app/code/local/Axovel/MenuItem/Helper/

我还制作了一个 Controller 文件(IndexController.php)作为:

    <?php
class Axovel_MenuItem_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{

$this->loadLayout();
$this->renderLayout();

}
}
?>

但没有得到想要的结果,我看不到我的自定义菜单项

即使我无法通过超链接直接调用我的 indexController/indexAction

http://127.0.0.1/magento/index.php/menuitem/index/index

config.xml 中有问题,但我无法弄清楚,有人可以帮忙吗?

谢谢:)

最佳答案

这看起来可能是缓存问题。如果您是 magento 的新手,缓存很容易被遗忘,并且确实会给您带来一些问题。您应该尝试在后端或命令行中清除它。缓存位于 var 文件夹中,您需要清空缓存文件夹和 full_page_cache 文件夹。

我不知道菜单按钮是否有效,因为您没有提供任何会生成新页面或 block 的代码。

关于magento - 我在管理面板 magento 中添加菜单时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35703097/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com