Zend Framework: How and where to create custom routes in a 1.8+ application? -


I have not created a custom route before, but in the end I need one. My question is: How can I make a path, and where do I create it? I am using Zend Framework 1.9.6.

Here's how I did it. There may be a better method, but I think it is as easy as it is:

  # /application/bootstrap.php protected function _initSpecialRoutes () {$ router = Zend_Controller_Front :: GetInstance () - & gt; GetRouter (); $ Router- & gt; Ad-root ('Verify', New Zend_Controller_Router_Route ('Verify /: Tokens', Array ('Administrator' = & gt; 'Account', 'Action' => 'Verify'))); $ Router- & gt; Add-root ('arbitrary-path-name', new Zend_Controller_Router_Route ('special / path /: variable name', array ('admin' = & gt; defaultcontrollername ',' action '=>' defaultactionname '))) ; }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -