我正在尝试使用Zend路由器创建子域,然后为子域下的每个部分创建子域,例如subdomain.site.com/section/我正在创建另一个路由,然后尝试将其链接到子域路由.但我不知道怎么做.我已经阅读了所有可以找到的文档和所有论坛,但它让我自己弄清楚了.到目前为止,我的尝试只是给我这个错误:
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
使用以下代码:
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
我找不到一个如何用网上任何地方的INI文件链接这个的例子.整个应用程序用INI编写,用于路由配置,因此我无法将其切换到基于数组的配置(或XML),其中100%的互联网示例都在其中.
如果我能以阵列形式完成,我可以这样说:
$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)
有没有人对如何在INI文件中执行上述操作有任何想法?