Yaf_Loader::isLocalName

(Yaf >=1.0.0)

Yaf_Loader::isLocalNameWhether a class is local

Description

public function Yaf_Loader::isLocalName(string $class_name): bool

Determine whether a class name should be looked up in the local library directory, i.e. whether its prefix belongs to a registered local namespace.

Parameters

class_name

The class name to check.

Return Values

Returns true if the class name belongs to a registered local namespace, false otherwise.

Examples

Example #1 Yaf_Loader::isLocalName() example

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

var_dump($loader->isLocalName("Models_Product"));
var_dump($loader->isLocalName("Vendor_Session"));
?>

The above example will output something similar to:

bool(true)
bool(false)

See Also

add a note

User Contributed Notes

There are no user contributed notes for this page.