Asf_Router_AbstractRoute::getRoutes

读取已经定义的所有路由配置


Description

public function getRoutes(void)

Parameters

此函数含有任何参数

Return Values

成功返回 Array, 无设置时返回 NULL

Examples

Example #1 这是核心部分代码

<?php
class Bootstrap
{
    public function _initOne($dispatcher)
    {
        $route = array(
            'service' => 'user',
            'action'  => 'top',
        );

        $route_news = array(
            'service' => 'news',
            'action'  => 'list',
        );

        $dispatcher->getRouter()->getRoutes();
        $dispatcher->getRouter()->addRoute('index', $route);

        var_dump($dispatcher->getRouter()->addRoute('news', $route_news));
    }
}