PHP 8.6.0 Beta 3 is available for testing

Yaf_Loader::getNamespaces

(Yaf >=3.2.0)

Yaf_Loader::getNamespacesAlias of getLocalNamespace

説明

public function Yaf_Loader::getNamespaces(): array

Alias of Yaf_Loader::getLocalNamespace().

パラメータ

この関数にはパラメータはありません。

戻り値

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

例1 Yaf_Loader::getNamespaces() example

<?php
$app    = new Yaf_Application(__DIR__ . "/conf/application.ini");
$loader = Yaf_Loader::getInstance();
$loader->registerLocalNamespace(array("Models", "Services"));

/* getNamespaces() is an alias of getLocalNamespace() */
var_dump($loader->getNamespaces() === $loader->getLocalNamespace());
?>

上の例の出力は、 たとえば以下のようになります。

bool(true)

参考

add a note

User Contributed Notes

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