1

I am developer, new to magento, and I just took over a project from another dev team so the code is totally strange to me. They built a custom module, and I have trouble figuring out when/where a certain action from inside a controller is triggered.

Here is the file structure/path: app -> code -> local -> FOLDER -> MODULE FOLDER -> controllers -> IndexController.php Inside this index controller lies the indexAction() action.

When is this action triggered? What should I look for? Any idea is helpful

dotancohen
  • 1,115
  • 6
  • 18
odin
  • 11
  • 1
  • I think you'll need to read through this:http://magento.stackexchange.com/questions/8344/how-to-write-a-custom-extension should give you a complete understanding. – SR_Magento Jan 22 '15 at 00:46

1 Answers1

2

After you enable the module, there is config.xml file for each module(which is at NAMESPACE/MODULENAME/etc/config.xml), there should be something like this:

<config>  
....

<frontend>
        <routers>
            <MODULENAME>
                <use>standard</use>
                <args>
                    <module>NAMESPACE_MODULENAME</module>
                    <frontName>path</frontName>
                </args>
            </MODULENAME>
        </routers>  
    </frontend>

...
</config>

According to your, Question you can reach controllers with following url: http://DOMAIN_NAME/path/index/index Here the path is from config.xml's , first index is IndexController and second index is method(action) indexAction() in IndexController.

P.S: -> FOLDER -> MODULE FOLDER ==> NAMESPACE -> MODULENAME

Prakash Thapa
  • 601
  • 1
  • 5
  • 16
  • and if I wanted to do a php redirect to that indexAction(), how would that look like? – odin Jan 21 '15 at 20:39
  • if you want to redirect from another controller to indexAction() then use: $this->_redirect('path/index/index'); from other Mage::app()->getResponse()->setRedirect(Mage::getUrl("path/index/index")) – Prakash Thapa Jan 21 '15 at 20:47
  • did it solve your problem? if so please mark as if so please mark as solved. – Prakash Thapa Jan 21 '15 at 20:52