PHP Conference Ehime 2026

Yaf_Application::getAppDirectory

(Yaf >=2.1.4)

Yaf_Application::getAppDirectoryGet the application directory

Beschreibung

public function Yaf_Application::getAppDirectory(): ?string

Get the application directory, under which Yaf looks for controllers, views and modules. It is set by the application.directory configuration entry, or by Yaf_Application::setAppDirectory().

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

The absolute path of the application directory, or null if the application is not properly initialized.

Beispiele

Beispiel #1 Yaf_Application::getAppDirectory() example

<?php
/* conf/application.ini:
   application.directory = APPLICATION_PATH "/application"
*/
$app = new Yaf_Application(
    new Yaf_Config_Ini(APPLICATION_PATH . "/conf/application.ini", "product")
);

var_dump($app->getAppDirectory());
var_dump(Yaf_Application::app()->getAppDirectory());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

string(31) "/var/www/html/myapp/application"
string(31) "/var/www/html/myapp/application"

Siehe auch

add a note

User Contributed Notes

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