Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I write Routing Chains for a Subdomain in Zend Framework in a routing INI file?
    text
    copied!<p>I am trying to create a subdomain using the Zend Router, and then for each section under a subdomain, such as subdomain.site.com/section/ I am creating another route and then trying to chain it to the subdomain route. but I don't know how. I have read all the documentation I could find and all the forums, but it leads me to figure it out on my own. So far, my attempts just get me this error:</p> <blockquote> <p>Catchable fatal error: Argument 2 passed to Zend_Controller_Router_Rewrite::addRoute() must implement interface Zend_Controller_Router_Route_Interface, null given, called in /var/local/zend/library/Zend/Controller/Router/Rewrite.php on line 155 and defined in /var/local/zend/library/Zend/Controller/Router/Rewrite.php on line 93</p> </blockquote> <p>with the following code:</p> <pre><code>routes.b2b.type = "Zend_Controller_Router_Route_Hostname" routes.b2b.route = "sales.sitename.com" routes.b2b.defaults.module = b2b routes.b2b.defaults.controller = index routes.b2b.defaults.action = index routes.b2b_signup.type = "Zend_Controller_Router_Route_Static" routes.b2b_signup.route = "/signup" routes.b2b_signup.defaults.controller = "index" routes.b2b_signup.defaults.action = "signup" routes.b2b_login.type = "Zend_Controller_Router_Route_Chain" routes.b2b_login.chain = b2b_signup </code></pre> <p>I cannot find an example of how to do chaining this with an INI file anywhere on the net. The entire application is written in an INI for the routing config, so I can't switch it over to an array based config (or XML for that matter), in which 100% of the examples on the internet are in.</p> <p>If I could do it in array form, I could just say this:</p> <pre><code>$hostnameRoute = new Zend_Controller_Router_Route_Hostname( 'sales.sitename.com', array( 'controller' =&gt; 'index', 'module' =&gt; 'b2b', 'action' =&gt; 'index' ) ); $hostnameRoute = new Zend_Controller_Router_Route_Static( '/signup', array( 'controller' =&gt; 'index', 'module' =&gt; 'b2b', 'action' =&gt; 'signup' ) ); $chainedRoute = new Zend_Controller_Router_Route_Chain(); $chainedRoute-&gt;chain($b2b_signup) </code></pre> <p>Does anyone have any ideas on how to do the above in an INI file?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload