PHP 8.6.0 Beta 3 is available for testing

Yaf_Loader::isLocalName

(Yaf >=1.0.0)

Yaf_Loader::isLocalNameWhether a class is local

Beschreibung

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.

Parameter-Liste

class_name

The class name to check.

Rückgabewerte

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

Beispiele

Beispiel #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"));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(true)
bool(false)

Siehe auch

add a note

User Contributed Notes

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