Skip to content

Instantly share code, notes, and snippets.

@webdawe
Last active June 28, 2018 06:23
Show Gist options
  • Save webdawe/764a2db2b52c600f6638e4137cdaf1a0 to your computer and use it in GitHub Desktop.
Save webdawe/764a2db2b52c600f6638e4137cdaf1a0 to your computer and use it in GitHub Desktop.

#Magento 1 #config.xml

<controller_front_init_routers>
<observers>
<vender>
<class>Vender_Model_Controller_Router</class>
<method>initControllerRouters</method>
</vender>
</observers>
</controller_front_init_routers>

#Router Class

class Vender_Model_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract
{
    public function initControllerRouters($observer)
    {
       $front = $observer->getEvent()->getFront();
       $front->addRouter('vendor_router', $this);
    }
   
   //logic for matching route will be inside this 
   //if we have config setting for each stores we can retrieve request path info 
  // and manipulate and assign controller and params and set alias			
  public function match(Zend_Controller_Request_Http $request)
  {
  }
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment