Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Loader::getLibraryPathYaf_Loader::getNamespacePath>
^Yaf_LoaderLast updated: Mon, 26 Oct 2026

Yaf_Loader::getLocalNamespace

(Yaf >=1.0.0)

Yaf_Loader::getLocalNamespace — Retrieve registered namespaces

Description

public function Yaf_Loader::getLocalNamespace(): array

Retrieve all registered local namespaces and their paths.

Parameters

This function has no parameters.

Return Values

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

Examples

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

The above example will output something similar to:

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

See Also


<Yaf_Loader::getLibraryPathYaf_Loader::getNamespacePath>
^Yaf_LoaderLast updated: Mon, 26 Oct 2026