Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Dispatcher::catchExceptionYaf_Dispatcher::disableView>
^Yaf_DispatcherLast updated: Mon, 26 Oct 2026

Yaf_Dispatcher::__construct

(Yaf >=1.0.0)

Yaf_Dispatcher::__construct — Yaf_Dispatcher constructor

Description

private function Yaf_Dispatcher::__construct()

Yaf_Dispatcher implements the singleton pattern, so the constructor is private. Use Yaf_Dispatcher::getInstance() to retrieve the dispatcher instance, which is created by Yaf_Application.

Parameters

This function has no parameters.

Return Values

No value is returned.

Examples

Example #1 Yaf_Dispatcher is a singleton

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

// Yaf_Dispatcher implements the singleton pattern, so its constructor is
// private. Retrieve the instance with Yaf_Dispatcher::getInstance()
// instead of calling `new`.
$dispatcher = Yaf_Dispatcher::getInstance();

var_dump($dispatcher instanceof Yaf_Dispatcher);
?>

The above example will output something similar to:

bool(true)

See Also


<Yaf_Dispatcher::catchExceptionYaf_Dispatcher::disableView>
^Yaf_DispatcherLast updated: Mon, 26 Oct 2026