Skip to content

Instantly share code, notes, and snippets.

@shamun
Created July 3, 2011 18:07
Show Gist options
  • Save shamun/1062435 to your computer and use it in GitHub Desktop.
Save shamun/1062435 to your computer and use it in GitHub Desktop.
<?php
/**
* Router - virtual link
*/
protected function _initRoutes()
{
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$dynamic = new Zend_Controller_Router_Route(
'/en/:variable1',
array(
'controller' => 'variable1',
'action' => 'index'),
array('variable1' => '^[a-zA-Z0-9_]*$')
);
$router->addRoute('dynamic', $dynamic);
}
?>
1) Visit /en/test
2) Get error
string(9) "variable1"
string(5) "error"
An error occurred
Page not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment