Skip to main content
added 284 characters in body
Source Link
philwinkle
  • 35.8k
  • 5
  • 91
  • 146

IndexController.php:IndexController.php:

loadLayout();$this->renderLayout();}
<?php

class VMRReports_AdminHelloWorld_IndexController extends Mage_Adminhtml_Controller_Action {
    public function indexAction() {
        echo 'Hello Index!';
        $this->loadLayout();
        $this->renderLayout();
        }
}
}config.xml:1.0adminVMRReports_AdminHelloWorldadminhelloworldupdates allow us to define our block layouts in a seperate file so are aren't messin' with the magento layout files.-->hello.xmlsection is for access control. Here we define the pieces where access can be controlled within a role.-->Hello Menu ItemExample Menu ItemVMRReports_HelloWorld_HelperVMRReports_HelloWorldWhat is wrong?

config.xml:

<config>
        <modules>
                <VMRReports_AdminHelloWorld>
                        <version>1.0</version>
                </VMRReports_AdminHelloWorld>
        </modules>
        <admin>
                <routers>
                        <VMRReports_AdminHelloWorld>
                                <use>admin</admin>
                                <args>
                                <modules>VMRReports_AdminHelloWorld</modules>
                                <frontName>adminhelloworld</frontName>
                                </args>
                        </VMRReports_AdminHelloWorld>
                </routers>
        </admin>
        <adminhtml>
        <!-- The <layout> updates allow us to define our block layouts in a seperate file so are aren't messin' with the magento layout files.  -->
        <layout>
            <updates>
                <hello>
                    <file>hello.xml</file>
                </hello>
            </updates>
        </layout>
        <!-- The <acl> section is for access control. Here we define the pieces where access can be controlled within a role. -->
        <acl>
            <resources>
                <admin>
                    <children>
                        <hello module="VMRReports_HelloWorld">
                            <title>Hello Menu Item</title>
                            <children>
                                <example translate="title" module="hello">
                                    <title>Example Menu Item</title>
                                </example>
                            </children>
                        </hello>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
    <global>
        <helpers>
            <helloworld>
                <class>VMRReports_HelloWorld_Helper</class>
            </helloworld>
        </helpers>
        <resources>
            <helloworld_setup>
                <setup>
                    <module>VMRReports_HelloWorld</module>
                </setup>
            </helloworld_setup>
        </resources>
    </global>
</config>

What is wrong?

IndexController.php:

loadLayout();$this->renderLayout();}}config.xml:1.0adminVMRReports_AdminHelloWorldadminhelloworldupdates allow us to define our block layouts in a seperate file so are aren't messin' with the magento layout files.-->hello.xmlsection is for access control. Here we define the pieces where access can be controlled within a role.-->Hello Menu ItemExample Menu ItemVMRReports_HelloWorld_HelperVMRReports_HelloWorldWhat is wrong?

IndexController.php:

<?php

class VMRReports_AdminHelloWorld_IndexController extends Mage_Adminhtml_Controller_Action {
    public function indexAction() {
        echo 'Hello Index!';
        $this->loadLayout();
        $this->renderLayout();
        }
}

config.xml:

<config>
        <modules>
                <VMRReports_AdminHelloWorld>
                        <version>1.0</version>
                </VMRReports_AdminHelloWorld>
        </modules>
        <admin>
                <routers>
                        <VMRReports_AdminHelloWorld>
                                <use>admin</admin>
                                <args>
                                <modules>VMRReports_AdminHelloWorld</modules>
                                <frontName>adminhelloworld</frontName>
                                </args>
                        </VMRReports_AdminHelloWorld>
                </routers>
        </admin>
        <adminhtml>
        <!-- The <layout> updates allow us to define our block layouts in a seperate file so are aren't messin' with the magento layout files.  -->
        <layout>
            <updates>
                <hello>
                    <file>hello.xml</file>
                </hello>
            </updates>
        </layout>
        <!-- The <acl> section is for access control. Here we define the pieces where access can be controlled within a role. -->
        <acl>
            <resources>
                <admin>
                    <children>
                        <hello module="VMRReports_HelloWorld">
                            <title>Hello Menu Item</title>
                            <children>
                                <example translate="title" module="hello">
                                    <title>Example Menu Item</title>
                                </example>
                            </children>
                        </hello>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
    <global>
        <helpers>
            <helloworld>
                <class>VMRReports_HelloWorld_Helper</class>
            </helloworld>
        </helpers>
        <resources>
            <helloworld_setup>
                <setup>
                    <module>VMRReports_HelloWorld</module>
                </setup>
            </helloworld_setup>
        </resources>
    </global>
</config>

What is wrong?

Source Link
user2045
  • 831
  • 3
  • 16
  • 29

Creating a Simple Admin Module - Routing Problem

All I'm trying to do is follow http://alanstorm.com/magento_admin_controllers basically to create a page in the admin section but it doesn't find it, 404.

IndexController.php:

loadLayout(); $this->renderLayout(); } } config.xml: 1.0 admin VMRReports_AdminHelloWorld adminhelloworld updates allow us to define our block layouts in a seperate file so are aren't messin' with the magento layout files. --> hello.xml section is for access control. Here we define the pieces where access can be controlled within a role. --> Hello Menu Item Example Menu Item VMRReports_HelloWorld_Helper VMRReports_HelloWorld What is wrong?