Each controller I need to define how many action can be
like saleAction()
, productAction()
something else.
But I want to make a action who receive all action like ......Action()
It's receive all request except indexAction()
. Is this possible only edit controller file?
Because now my URL like http://www.example.com/controller/action/parameter
I need to convert that http://www.example.com/controller/action_as_parameter/somethings_if_need
UPDATE
Actually I not make yet. But I want to make a simple routers
like
<frontend>
<routers>
<marketshop>
<use>standard</use>
<args>
<module>Myname_Mymodule</module>
<frontName>market</frontName>
</args>
</marketshop>
</routers>
</frontend>
And controllers also simple. If I can this way then I make my module or find another way
class Myname_Mymodule_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction(){
$this->loadLayout();
$this->renderLayout();
}
public function globalAction(){
// I want all action comes here and doing somethings
// their not have any 404 page
}
}
Best Answer
you will need a custom router.
Add this inside the
global
tag inconfig.xml
Then create the class
Myname_Mymodule_Controller_Router
.