Reputation: 71
For a custom module I created a new actioncontroller. But it doesn't execute. It's returns only a 404. I tried already some solutions from stackoverflow, but no one is working for me. :(
Urls I tried to call my action:
Can you take a look in my code? Maybe it's just a typo I didn't see.
Crmart/Medipim/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Crmart_Medipim>
<version>0.1.0</version>
</Crmart_Medipim>
</modules>
<frontend>
<routers>
<medipim>
<use>standard</use>
<args>
<module>Crmart_Medipim</module>
<frontName>medipim</frontName>
</args>
</medipim>
</routers>
</frontend>
</config>
Crmart/Medipim/controllers/SyncController.php
class Crmart_Medipim_SyncController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
//
echo 'hello world!';
}
public function nowAction()
{
// ...
}
}
app/etc/modules/Crmart_Medipim.xml
<?xml version="1.0"?>
<config>
<modules>
<Crmart_Medipim>
<active>true</active>
<codePool>local</codePool>
</Crmart_Medipim>
</modules>
</config>
Upvotes: 0
Views: 955
Reputation: 1203
Plug-in files created correctly check once below steps for you plug-in works.
Check that plugin is successfully registered or not form admin section Admin ->System->configuration->Advance check plugin is listed here
open the app/etc/local.xml and check the below line
<disable_local_modules>false</disable_local_modules>
the value must be false otherwise plugin will not work
Upvotes: 0
Reputation: 71
Ok. Fixed!
I had enabled to view storecodes in my url.
So when I enter http://pharmaprofit.dev/nl/medipim/sync/now
instead of http://pharmaprofit.dev/medipim/sync/now
, it's working!
Upvotes: 1