Y
Y
yv19952016-10-05 18:56:07
Magento
yv1995, 2016-10-05 18:56:07

What should be the name of controllers in magento?

Here is the code snippet from the etc/config.xml file

<adminhtml>
    <menu>
        <cmindscmsmenu module="cmindscmsmenu">
            <title>CMS Menu</title>
            <sort_order>100</sort_order>
            <action>cmindscmsmenu_admin/adminhtml_cmsmenu</action>			
        </cmindscmsmenu>
    </menu>
</adminhtml>

Here, in fact, the controller itself controllers/CmsMenuController.php
<?php

class Cminds_CmsMenu_Adminhtml_CmsMenuController extends Mage_Adminhtml_Controller_Action
{
  public function indexAction()
  {
            $this->loadLayout();
            $this->_setActiveMenu('cmindscmsmenu');

            $contentBlock = $this->getLayout()->createBlock('cmindscmsmenu/adminhtml_CmsMenu');
          
            $this->_addContent($contentBlock);
            $this->renderLayout();
  }
}

In the browser, when I click on the link
magento.dev/index.php/cmindscmsmenu_admin/adminhtml_cmsmenu/index/key/08c8a4c5094a4609b84df9adb3fc02ac/
I get a 404 error!
But if in config.xml in action replace cmindscmsmenu_admin/adminhtml_CmsMenu, i.e. put capital letters, then everything works! The controller is loading!
Is it possible to name the controller the way I have it named? Or what could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question