Yaf_Dispatcher::getInstance

Retrieve the dispatcher instance

Description

public static Yaf_Dispatchernull Yaf_Dispatcher::getInstance()

Retrieve the single Yaf_Dispatcher instance.

Parameters

This function has no parameters.

Return Values

The Yaf_Dispatcher instance, or null if no Yaf_Application has been initialized yet.

Examples

Example #1 Yaf_Dispatcher::getInstance example

<?php
$app = new Yaf_Application(dirname(__FILE__) . "/conf/application.ini");

$dispatcher = Yaf_Dispatcher::getInstance();

var_dump($dispatcher === Yaf_Dispatcher::getInstance());
?>

The above example will output something similar to:

bool(true)

See Also

  • Yaf_Application::getDispatcher