php - How do I write Routing Chains for a Subdomain in Zend Framework in a routing INI file? -


I am trying to create a subdomain, using the Z Router, and then under each sub-domain, such as Subdomain .com / section / I'm making another route and then trying to sort it into the subdomain path. But I do not know how I have read all the documents and have read all the forums, but I have to find out this on my own. So far, my attempts just gives me this error:

Catchable were passed Fatal Error: Argument 2 :: addRoute (Zend_Controller_Router_Rewrite) interface must implement Zend_Controller_Router_Route_Interface, null, see it / Var is defined in the / local / line 155 zend / library / zend / controller / router / rewrite.php and line 93 in /var/local/zend/library/Zend/Controller/Router/Rewrite.php < / P>

with the following code:

  routes.b2b.type = "Zend_Controller_Router_Route_Hostname" routes.b2b.route = "sales.sitename.com" routes.b2b .defaults.module = b2b routes.b2b .defaults.controller = Suggestion A routes.b2b.defaults.action = index routes.b2b_signup.type = "Zend_Controller_Router_Route_Static" routes.b2b_signup.route = "/ signup" Routeskb2b_signupkdefaultskcontroller = "index" routes.b2b_signup.defaults .action = "signup "routes.b2b_login.type =" Zend_Controller_Router_Route_Chain "routes.b2b_login.chain = b2b_signup  

example of me anywhere but can not find the net on how to ease it with an INI file. The entire app is written in INI for routing config, so I can not change it on an array based configuration (or XML for that matter), in which there are 100% examples on the Internet.

If I can do it in array form, then I can say:

'index')); $ HostnameRoute = New Zend_Controller_Router_Route_Static ('/ signup', array ('Controller' => gt; 'index', 'module' => 'b2b', 'action' => signup '); $ ChainedRoute = new Zend_Controller_Router_Route_Chain (); $ ChainedRoute-> Series ($ b2b_signup)

How to do any of the above in the INI file?

After the

here is basically what you want in INI format:

  routes.b2b.type = "Zend_Controller_Router_Route_Hostname" routes.b2b.route = "Sales.sitename.com"; You can specify a default module (or anything) to use for the whole; Here the route chain, similarly:; routes.b2b.defaults.module = "default" routes.b2b.chains.signup.type = "Zend_Controller_Router_Route_Static" routes.b2b.chains.signup.route = "/ signup" routes.b2b.chains.signup.defaults.controller = "Index" routes B2b Chains.ignup.defaults.action = "signup" routes. B2b Chains. Otherwise RUTE = "/ some /: FU"; Etc., etc routes.b2b.chains.anotherroute.defaults.action = "foo" routes.b2b.chains.anotherroute.defaults.controller = "index" routes.b2b.chains.anotherroute.defaults.foo = "bar" routes. B2b.chains.anotherroute.reqs.foo = '[az] +'  

This will give you the following routes: b2b-signup , and b2 B-Other Route: .

There are some important notes on the route chains:

When the paths meet together, the higher priority is compared to the parameters of the outer path parameter. If you define an controller in the inner path, then the controller of the outer path will be chosen.

Parents / hair transit pathways are always added to a dash! Therefore, like the above given example, a code named b2b.chains.signup becomes a b2b-signup (which you can use for the URL assembly, etc.) Are).

You can keep chaining! Chains of chains can be chains.

Children of chained routes do not work with wildcards. Here's why it can not be a big deal.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -