0

VMRReports/AdminHelloWorld/etc/config.xml:

<?xml version="1.0"?>
<config>
    <module>
        <VMRReports_AdminHelloWorld>  <!-- Explain this line so like: Namespace_Modulename_IDunno -->
            <version>1.0</version>
        </VMRReports_AdminHelloWorld>
    </module>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <helloworld before="Mage_Adminhtml">VMRReports_AdminHelloWorld</helloworld>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

HelloWorldController.php:

<?php 

class VMRReports_AdminHelloWorld_HelloWorldController extends Mage_Adminhtml_Controller_Action {        
    protected $_publicActions = array('index');
    public function IndexAction() {
        echo 'Hello Index! HelloWorld';
//  $this->loadLayout();
//  $this->renderLayout();
    }
}

================================

This shows up in /magento/index.php/admin/HelloWorld/index/

How do I get it to show up in

/magento/index.php/admin/helloworld/index/ ???

And by this I meant, is it possible to use the camel case I am using while forcing the URL to remain all lowercase?

1
  • I think the answer below is the right answer, because I saw an other question you posted as a follow-up. Please accept the answer so you don't leave loose end. It breaks the website statistics and while in beta it could really use good figures.
    – Marius
    Commented May 15, 2013 at 17:06

1 Answer 1

2

Just name your controller
VMRReports_AdminHelloWorld_HelloworldController instead of
VMRReports_AdminHelloWorld_HelloWorldController

Also the file name should be HelloworldController.php: (lowercase 'w').

EDIT
Although it should work the way you do it just by changing what I suggested, the best practice is to put your admin controllers in a folder called Adminhtml to separate them from the front controllers.
So the file should actually be app/code/local/VMRReports/AdminHelloWorld/controllers/Adminhtml/HelloworldController.php
The class name should be VMRReports_AdminHelloWorld_Adminhtml_HelloworldController
and the config routing should be:

<helloworld before="Mage_Adminhtml">VMRReports_AdminHelloWorld_Adminhtml</helloworld>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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