Dutch PHP Conference 2027

Yaf_Loader::getLocalNamespace

(Yaf >=1.0.0)

Yaf_Loader::getLocalNamespaceRetrieve registered namespaces

Beschreibung

public function Yaf_Loader::getLocalNamespace(): array

Retrieve all registered local namespaces and their paths.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

An array of the registered local namespaces, keyed by the namespace prefix, or an empty array if none are registered.

Beispiele

Beispiel #1 Yaf_Loader::getLocalNamespace() example

<?php
$app    = new Yaf_Application(__DIR__ . "/conf/application.ini");
$loader = Yaf_Loader::getInstance();

$loader->registerLocalNamespace("Models");
$loader->registerLocalNamespace("Vendor", APPLICATION_PATH . "/library/Vendor");

print_r($loader->getLocalNamespace());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Array
(
    [Models] => /var/www/shop/application/library
    [Vendor] => /var/www/shop/application/library/Vendor
)

Siehe auch

add a note

User Contributed Notes

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