Asf_Dispatcher::getRouter

获取当前路由加载信息


Description

public Asf_Router Asf_Dispatcher::getRouter(void)

Return Values

Object 代表返回成功, NULL 代表失败

Examples

Example #1

<?php
use Asf\Application as App;
use Asf\Dispatcher;

$configs = array(
    'asf' => array(
        'root_path' => realpath(dirname(__FILE__)),
        'dispatcher' => array(
            'route' => array(
                'type' => 'query',
                'module_name'  => 'm',
                'service_name' => 'c',
                'action_name'  => 'a',
            )
        )
    )
);

class IndexService
{
    public function indexAction()
    {
        print_r(Dispatcher::getInstance()->getRouter());
    }
}

$handle = new App($configs);
$handle->run();