php8.5
Home/ Manual/ yaf / yaf_application/ Yaf_Application::getModules

Yaf_Application::getModules

PHP function Edit on GitHub ✎

(Yaf >=1.0.0)

Get defined module names

Description

Yaf_Application::getModules(): array|null

Get the module names defined in the application.modules configuration entry. If none is defined, there will always be a single module named "Index".

Parameters Parameters

Return Values

An array of module names, or null if the application is not properly initialized.

Examples

Yaf_Application::getModules() example

php
<?php
$config = array(
    "application" => array(
        "directory" => realpath(dirname(__FILE__)) . "/application",
    ),
);

/** Yaf_Application */
$application = new Yaf_Application($config);
print_r($application->getModules());
?>

The above example will output something similar to:

output
Array
(
    [0] => Index
)

Source: reference/yaf/yaf_application/getmodules.xml · from the official PHP manual (php/doc-en)