Created
July 3, 2011 18:07
-
-
Save shamun/1062435 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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