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::flushInstantlyYaf_Dispatcher::getDefaultAction>
^Yaf_DispatcherLast updated: Mon, 26 Oct 2026

Yaf_Dispatcher::getApplication

(Yaf >=1.0.0)

Yaf_Dispatcher::getApplication — Retrieve the application

Description

public function Yaf_Dispatcher::getApplication(): ?Yaf_Application

Retrieve the Yaf_Application instance. Same as Yaf_Application::app().

Parameters

This function has no parameters.

Return Values

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

Examples

Example #1 Yaf_Dispatcher::getApplication() example

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

var_dump(Yaf_Dispatcher::getInstance()->getApplication() === Yaf_Application::app());
?>

The above example will output something similar to:

bool(true)

See Also


<Yaf_Dispatcher::flushInstantlyYaf_Dispatcher::getDefaultAction>
^Yaf_DispatcherLast updated: Mon, 26 Oct 2026