skip to Main Content

For example:
The url is

index.php/catalogsearch/advanced/

how to find out which module it belongs to ? In this case I know that the frontname is “catalogsearch”, the controller is “advanced” and the method is “indexAction” ? But to what module does it belong?

In this case it is easy because the name of the frontname and the name of the module match but if they were different? how can we find the module of the frontname ?

2

Answers


  1. The answer is here, in the config.xml file of the module Mage_CatalogSearch :

    <routers>
            <catalogsearch>
                <use>standard</use>
                <args>
                    <module>Mage_CatalogSearch</module>
                    <frontName>catalogsearch</frontName>
                </args>
            </catalogsearch>
     </routers>
    

    So I hope you have a good IDE which allows you to perform searches on all files. If you’re unable to perform a search, you could edit a template used in the page of the URL you’re after, and dump this in a log file :

    Mage::app()->getRequest()->getControllerModule();
    

    This will give you "Mage_CatalogSearch". Additionnally, you might want to use these methods too :

    Mage::app()->getRequest()->getControllerName();
    Mage::app()->getRequest()->getActionName();
    
    Login or Signup to reply.
  2. //Write below code in index.php file or any phtml files.

    /**
     * get module name
     */
    $this->getRequest()->getModuleName();
    

    More details got through the this link.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search