PHP 8.6.0 Beta 3 is available for testing

Yaf_Loader::getLocalNamespace

(Yaf >=1.0.0)

Yaf_Loader::getLocalNamespaceRetrieve registered namespaces

Descrizione

public function Yaf_Loader::getLocalNamespace(): array

Retrieve all registered local namespaces and their paths.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

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

Esempi

Example #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());
?>

Il precedente esempio visualizzerà qualcosa simile a:

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

Vedere anche:

add a note

User Contributed Notes

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