PHP 8.6.0 Beta 3 is available for testing

Yaf_Application::setAppDirectory

(Yaf >=2.1.4)

Yaf_Application::setAppDirectoryChange the application directory

Açıklama

public function Yaf_Application::setAppDirectory(string $directory): Yaf_Application|null|false

Change the application directory, under which Yaf looks for controllers, views and modules. The new directory must be an absolute path.

Bağımsız Değişkenler

directory

The absolute path of the new application directory.

Dönen Değerler

Returns the Yaf_Application object itself on success, false if directory is empty or not an absolute path, or null if the application is not properly initialized.

Örnekler

Örnek 1 Yaf_Application::setAppDirectory() example

<?php
$app = Yaf_Application::app();

/* returns the application itself on success, for chaining */
var_dump($app->setAppDirectory("/srv/legacy/mvc/app"));
var_dump($app->getAppDirectory());

/* an empty or relative path is rejected */
var_dump($app->setAppDirectory(""));
var_dump($app->setAppDirectory("relative/path"));
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

object(Yaf_Application)#1 (0) {
}
string(20) "/srv/legacy/mvc/app"
bool(false)
bool(false)

Ayrıca Bakınız

add a note

User Contributed Notes

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