略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_Application::getDispatcher

2024-11-13

Yaf_Application::getDispatcher

(Yaf >=1.0.0)

Yaf_Application::getDispatcher获取 Yaf_Dispatcher 的实例

说明

public Yaf_Application::getDispatcher(): Yaf_Dispatcher

参数

此函数没有参数。

返回值

范例

示例 #1 Yaf_Application::getDispatcher()example

<?php
$config 
= array(
    
"application" => array(
        
"directory" => realpath(dirname(__FILE__)) . "/application",
    ),
);

/** Yaf_Application */
$application = new Yaf_Application($config);
print_r($application->getDispatcher());
?>

以上例程的输出类似于:

Yaf_Dispatcher Object
(
    [_router:protected] => Yaf_Router Object
        (
            [_routes:protected] => Array
                (
                    [_default] => Yaf_Route_Static Object
                        (
                        )

                )

            [_current:protected] => 
        )

    [_view:protected] => 
    [_request:protected] => Yaf_Request_Http Object
        (
            [module] => 
            [controller] => 
            [action] => 
            [method] => Cli
            [params:protected] => Array
                (
                )

            [language:protected] => 
            [_exception:protected] => 
            [_base_uri:protected] => 
            [uri:protected] => 
            [dispatched:protected] => 
            [routed:protected] => 
        )

    [_plugins:protected] => Array
        (
        )

    [_auto_render:protected] => 1
    [_return_response:protected] => 
    [_instantly_flush:protected] => 
    [_default_module:protected] => Index
    [_default_controller:protected] => Index
    [_default_action:protected] => index
    [_response] => Yaf_Response_Cli Object
        (
            [_header:protected] => Array
                (
                )

            [_body:protected] => 
            [_sendheader:protected] => 
        )

)
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/yaf-application.getdispatcher.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3