0

I want to access my admin controller form browser URL i tried but its giving every time 404 page can you please help me what i am doing wrong

http://magento.example.com/admin/namespace_quickorder/QuickorderController/index http://magento.example.com/admin/quickorder/QuickorderController/index

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Quickorder>
            <version>0.1.1</version>
        </Namespace_Quickorder>
    </modules>
    <frontend>
        <routers>
            <quickorder>
                <use>standard</use>
                <args>
                    <module>Namespace_Quickorder</module>
                    <frontName>quickorder</frontName>
                </args>
            </quickorder>
        </routers>
        <layout>
            <updates>
                <quickorder>
                    <file>quickorder.xml</file>
                </quickorder>
            </updates>
        </layout>
    </frontend>
    <global>
        <helpers>
            <quickorder>
                <class>Namespace_Quickorder_Helper</class>
            </quickorder>
        </helpers>   
        <blocks>
            <quickorder>
                <class>Namespace_Quickorder_Block</class>
            </quickorder>
        </blocks>
        <models>
            <quickorder>
                <class>Namespace_Quickorder_Model</class>
                    <resourceModel>quickorder_mysql4</resourceModel>
            </quickorder>
            <quickorder_mysql4>
                <class>Namespace_Quickorder_Model_Mysql4</class>
                <entities>
                    <quickorder>
                        <table>quickorder</table>
                    </quickorder>
                </entities>
            </quickorder_mysql4>
        </models>
        <resources>
            <quickorder_setup>
                <setup>
                    <module>Namespace_Quickorder</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </quickorder_setup>
            <quickorder_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </quickorder_write>
            <quickorder_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </quickorder_read>
        </resources>
   </global> 
   <admin>
            <routers>
                <quickorder>
                    <use>admin</use>
                    <args>
                        <module>Namespace_Quickorder</module>
                        <frontName>quickorder</frontName>
                    </args>
                </quickorder>
            </routers>
            </admin><adminhtml>
        <menu>
            <quickorder module="quickorder">
                <title>Quickorder</title>
                <sort_order>80</sort_order>
                <children>
                <quickorder module="quickorder">
                        <title>Manage Quickorder</title>
                        <sort_order>10</sort_order>
                        <action>quickorder/adminhtml_quickorder</action>
                    </quickorder>
                </children>
            </quickorder>
        </menu>
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <quickorder translate="title" module="quickorder">
                            <title>Quickorder</title>
                            <sort_order>1000</sort_order>
                            <children>
                                <quickorderbackend translate="title">
                                    <title>Free Catalog</title>
                                </quickorderbackend><quickorder translate="title">
                                    <title>Manage Quickorder</title>
                                </quickorder>
                            </children>
                       </quickorder>
                    </children>
                </admin>

            </resources>
        </acl>

        <layout>
            <updates>
                <quickorder>
                    <file>quickorder.xml</file>
                </quickorder>
            </updates>
        </layout>
    </adminhtml>

</config> 

Admin Controller :

<?php

class Namespace_Quickorder_Adminhtml_QuickorderController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction() 
    {
        die('dddddddddddd');
        $this->_initAction();
        $this->renderLayout();
    }
}
  • Controller is not used in the URL. Try http://magento.example.com/admin/quickorder/Quickorder – Tim Cieplowski Aug 5 '17 at 13:11
0

etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Quickorder>
            <version>0.1.1</version>
        </Namespace_Quickorder>
    </modules>
    <global>
        <helpers>
            <quickorder>
                <class>Namespace_Quickorder_Helper</class>
            </quickorder>
        </helpers>   
        <blocks>
            <quickorder>
                <class>Namespace_Quickorder_Block</class>
            </quickorder>
        </blocks>
        <models>
            <quickorder>
                <class>Namespace_Quickorder_Model</class>
                <resourceModel>quickorder_mysql4</resourceModel>
            </quickorder>
            <quickorder_mysql4>
                <class>Namespace_Quickorder_Model_Mysql4</class>
                <entities>
                    <quickorder>
                        <table>quickorder</table>
                    </quickorder>
                </entities>
            </quickorder_mysql4>
        </models>
        <resources>
            <quickorder_setup>
                <setup>
                    <module>Namespace_Quickorder</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </quickorder_setup>
            <quickorder_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </quickorder_write>
            <quickorder_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </quickorder_read>
        </resources>
    </global> 
    <frontend>
        <routers>
            <quickorder>
                <use>standard</use>
                <args>
                    <module>Namespace_Quickorder</module>
                    <frontName>quickorder</frontName>
                </args>
            </quickorder>
        </routers>
        <layout>
            <updates>
                <quickorder>
                    <file>quickorder.xml</file>
                </quickorder>
            </updates>
        </layout>
    </frontend>
   <admin>
       <routers>
           <quickorder>
               <use>admin</use>
               <args>
                   <module>Namespace_Quickorder</module>
                   <frontName>quickorder</frontName>
               </args>
           </quickorder>
       </routers>
   </admin>
<adminhtml>
   <menu>
       <quickorder module="quickorder">
           <title>Quickorder</title>
           <sort_order>80</sort_order>
           <children>
               <quickorder module="quickorder">
                   <title>Manage Quickorder</title>
                   <sort_order>10</sort_order>
                   <action>quickorder/adminhtml_quickorder</action>
               </quickorder>
           </children>
       </quickorder>
   </menu>
   <acl>
       <resources>
           <all>
               <title>Allow Everything</title>
           </all>
           <admin>
               <children>
                   <quickorder translate="title" module="quickorder">
                       <title>Quickorder</title>
                       <sort_order>1000</sort_order>
                       <children>
                           <quickorderbackend translate="title">
                               <title>Free Catalog</title>
                           </quickorderbackend>
                           <quickorder translate="title">
                               <title>Manage Quickorder</title>
                           </quickorder>
                        </children>
                    </quickorder>
                </children>
            </admin>
        </resources>
    </acl>
    <layout>
        <updates>
            <quickorder>
                <file>quickorder.xml</file>
            </quickorder>
        </updates>
    </layout>
</adminhtml>
</config> 

Adminhtml/QuickorderController.php

class Namespace_Quickorder_Adminhtml_QuickorderController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction() 
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

Now if you type www.domaine.com/index.php/admin/quickorder/index you will load your layout

Nb: The Url is composed like this :

www.domaine.com/index.php/{adminfrontName}/{controllerName}/{actionName}

Dont forget to check your layout! quickorder.xml it's very important otherwise if you have some error on it, you will not render it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.