Решено:Если в расширении нет папки adminhtml.xml и Adminhtml, как решить проблему 404?
-
13-12-2019 - |
Вопрос
После применения патча 6788 я знаю, что config.xml необходимо редактировать.В моем расширении нет папки Adminhtml и ее XML-файла, поэтому после внесения изменений я все равно получаю 404.Ниже приведен файл config.xml.Каким будет правильное выражение «действие»?
<?xml version="1.0"?>
<config>
<modules>
<J_G>
<version>1.0.0</version>
</J_G>
</modules>
<global>
<helpers>
<g>
<class>J_G_Helper</class>
</g>
</helpers>
<blocks>
<j_g>
<class>J_G_Block</class>
</j_g>
</blocks>
</global>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<J_G after="Mage_Adminhtml">J_G_Adminhtml</J_G>
<frontName>g</frontName>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<adminhtml>
<menu>
<gr>
<children>
<custom translate="title" module="g">
<title>Custom</title>
<sort_order>90</sort_order>
<children>
<sales translate="title" module="g">
<title>Sales</title>
<sort_order>10</sort_order>
<children>
<top translate="title" module="g">
<title>Payment Method</title>
<sort_order>10</sort_order>
<action>adminhtml/g_sales_paymentmethod</action>
</top>
</children>
</sales>
</children>
</custom>
</children>
</gr>
</menu>....
Решение
Ваше действие должно быть
adminhtml/sales_paymentmethod/YourActionName
от
adminhtml/g_sales_paymentmethod
Правила:
adminRouterName/Lowecase(ClassNameFromAdminhtmlFolderTOController)/ActionName
Обновлять
Ваш путь к контроллеру должен быть
../J/G/controllers/Adminhtml/Sales/PaymentmethodController.php
Имя класса должно быть
J_G_Adminhtml_Sales_PaymentmethodController
Другие советы
<routers>
<adminhtml>
<args>
<modules>
<G before="Mage_Adminhtml">J_G_Adminhtml</G>
</modules>
</args>
</adminhtml>
</routers>`
.
Я думаю?
Не связан с magento.stackexchange