PHP 8.5.10 Released!

Yaf_Dispatcher::getInstance

(Yaf >=1.0.0)

Yaf_Dispatcher::getInstanceRetrieve the dispatcher instance

Description

public static function Yaf_Dispatcher::getInstance(): ?Yaf_Dispatcher

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

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top