Skip to content

Instantly share code, notes, and snippets.

@christophervalles
Created March 23, 2012 16:28
Show Gist options
  • Save christophervalles/2172456 to your computer and use it in GitHub Desktop.
Save christophervalles/2172456 to your computer and use it in GitHub Desktop.
Get the route name (if exists) that matches the given url in Zend Framework
<?php
$referrer = $this->getRequest()->getServer('HTTP_REFERER');
$request = new Zend_Controller_Request_Http($referrer);
$router = clone $this->getFrontController()->getRouter();
$router->route($request);
$routeName = $router->getCurrentRouteName();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment