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:
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
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 = 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
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.
If I could do it in array form, I could just say this:
$hostnameRoute = new Zend_Controller_Router_Route_Hostname(
'sales.sitename.com',
array(
'controller' => 'index',
'module' => 'b2b',
'action' => 'index'
)
);
$hostnameRoute = new Zend_Controller_Router_Route_Static(
'/signup',
array(
'controller' => 'index',
'module' => 'b2b',
'action' => 'signup'
)
);
$chainedRoute = new Zend_Controller_Router_Route_Chain();
$chainedRoute->chain($b2b_signup)
Does anyone have any ideas on how to do the above in an INI file?