【发布时间】:2014-05-02 05:14:30
【问题描述】:
我需要在 ZF2 中为这些域创建子域路由:
<?=$this->url('subdomain', array('subdomain' => 'sub'));?>
// sub.domain.ltd
<?=$this->url('subdomain/static/js', array('file' => 'jquery.js'));?>
// static.domain.ltd/js/jquery.js
我该怎么做?有什么想法吗?
第一个基本路线很容易:
'subdomain' => array(
'type' => 'hostname',
'options' => array(
'route' => ':subdomain.domain.ltd',
'constraints' => array(
'subdomain' => '[a-zA-Z][a-zA-Z0-9_-]*'
),
'defaults' => array(
'subdomain' => 'www',
),
),
'may_terminate' => true,
'child_routes' => array(),
),
但是我必须在 child_routes 中写什么来管理我的任务?
【问题讨论】:
标签: php zend-framework routing zend-framework2 url-routing