Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.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
Magento adminhtml子菜单不工作_Magento_Submenu_Magento 1.7_Adminhtml - Fatal编程技术网

Magento adminhtml子菜单不工作

Magento adminhtml子菜单不工作,magento,submenu,magento-1.7,adminhtml,Magento,Submenu,Magento 1.7,Adminhtml,这个问题快把我们逼疯了,已经有几个小时了,什么都没有,我在尝试访问第二个子菜单时遇到了404错误,关键字一。我确信错误应该在控制器或布局上,但我无法找到它。我正在发布配置、控制器和布局文件。如果需要更多,也可以添加,但我认为有了这些就足够了。我使用的是来自AlanStorm的CommerceBug,块和网格都正确加载 以下是我的不同文件代码: config.xml 关键字backendcontroller.php 布局,allpages.xml 一切都很好。问题出在文件名上,因为我不知道控制器名

这个问题快把我们逼疯了,已经有几个小时了,什么都没有,我在尝试访问第二个子菜单时遇到了404错误,关键字一。我确信错误应该在控制器或布局上,但我无法找到它。我正在发布配置、控制器和布局文件。如果需要更多,也可以添加,但我认为有了这些就足够了。我使用的是来自AlanStorm的CommerceBug,块和网格都正确加载

以下是我的不同文件代码:

config.xml

关键字backendcontroller.php

布局,allpages.xml


一切都很好。问题出在文件名上,因为我不知道控制器名如何为KeywordsbackendController.php.php,当然,找不到文件。但奇怪的是,我没有任何例外或相似之处。嗯,Magento模糊了内部结构,我已经习惯了。

请参考下面Url中的答案:你是什么意思?现在我看到你的网址了。与此无关,我已经让所有的东西都工作了,通过使用CommerceBug实例化的块,错误正如我在错误的文件名上所说的。
<?xml version="1.0"?>
<config>
    <modules>
        <Dts_Allpages>
            <version>0.1.0</version>
        </Dts_Allpages>
    </modules>
    <global>
        <models>
            <allpages>
                <class>Dts_Allpages_Model</class>
                <resourceModel>allpages_resource</resourceModel>
            </allpages>
            <allpages_resource>
                <class>Dts_Allpages_Model_Resource</class>
                <entities>
                    <referencedpages>
                        <table>referencedpages</table>
                    </referencedpages>
                    <keywords>
                        <table>keywords</table>
                    </keywords>
                </entities>
            </allpages_resource>
        </models>
        <events>
            <controller_action_predispatch>
                <observers>
                    <controller_action_before>
                        <class>allpages/observer</class>
                        <method>saveReferrer</method>
                    </controller_action_before>
                </observers>
            </controller_action_predispatch>
        </events>
        <helpers>
            <allpages>
                <class>Dts_Allpages_Helper</class>
            </allpages>
        </helpers>
        <resources>
            <allpages_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </allpages_write>
            <allpages_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </allpages_read>
        </resources>
        <blocks>
          <allpages>
            <class>Dts_Allpages_Block</class>
          </allpages>
        </blocks>
    </global>
    <admin>
        <routers>
            <allpages>
                <use>admin</use>
                    <args>
                        <module>Dts_Allpages</module>
                        <frontName>allpages</frontName>
                    </args>
            </allpages>
        </routers>
    </admin>
    <adminhtml>
        <menu>
          <allpagesmainmenu translate="title" module="allpages">
            <title>AllPages</title>
            <sort_order>100</sort_order>
            <children>
              <allpages module="allpages">
                <title>Keywords administration</title>
                <sort_order>0</sort_order>
                <children>
                    <references translate="title">
                        <title>References</title>
                        <sort_order>10</sort_order>
                        <action>allpages/adminhtml_allpagesbackend</action>
                    </references>
                    <keywords translate="title">
                        <title>Keywords</title>
                        <sort_order>20</sort_order>
                        <action>allpages/adminhtml_keywordsbackend</action>
                    </keywords>
                </children>
              </allpages>
            </children>
          </allpagesmainmenu>
        </menu>
        <acl>
          <resources>
            <admin>
              <children>
                <allpagesmainmenu translate="title" module="allpages">
                  <title>All Pages</title>
                  <children>
                    <allpages translate="title">
                        <title>Keywords administration</title>
                        <children>
                            <references translate="title">
                                <title>References</title>
                                <sort_order>10</sort_order>
                            </references>
                            <keywords translate="title">
                                <title>Keywords</title>
                                <sort_order>20</sort_order>
                            </keywords>
                        </children>
                    </allpages>
                  </children>
                </allpagesmainmenu>
              </children>
            </admin>
          </resources>
        </acl>
        <layout>
          <updates>
            <allpages>
              <file>allpages.xml</file>
            </allpages>
          </updates>
        </layout>
    </adminhtml>
</config>
<?php
class Dts_Allpages_Adminhtml_KeywordsbackendController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->_title($this->__("Administrador de keywords"));
        $this->renderLayout();
    }
}
<?xml version="1.0"?>
<layout version="0.1.0">
  <allpages_adminhtml_allpagesbackend_index>
      <reference name="content">
          <block type="allpages/adminhtml_allpagesbackend" name="allpagesbackend"/>
      </reference>
  </allpages_adminhtml_allpagesbackend_index>
  <allpages_adminhtml_allpagesbackend_edit>
      <reference name="content">
          <block type="allpages/adminhtml_allpagesbackend_edit" name="allpagesbackend_edit" />
      </reference>
  </allpages_adminhtml_allpagesbackend_edit>
  <allpages_adminhtml_keywordsbackend_index>
      <reference name="content">
          <block type="allpages/adminhtml_keywordsbackend" name="keywordsbackend"/>
      </reference>
  </allpages_adminhtml_keywordsbackend_index>
  <allpages_adminhtml_keywordsbackend_edit>
        <reference name="content">
            <block type="allpages/adminhtml_keywordsbackend_edit" name="keywordsbackend_edit" />
        </reference>
  </allpages_adminhtml_keywordsbackend_edit>
</layout>