1
我需要在ZF2一个子域路由用于这些领域:Zend框架2子域路由
<?=$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写来管理我的任务是什么?
我不需要使用布局,我只需要一个URL。所以我只需要有一个正确的路线。 – Aliance