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

Yaf_Application::getConfig

PHP function Edit on GitHub ✎

(Yaf >=1.0.0)

Retrieve the config instance

Description

Yaf_Application::getConfig(): Yaf_Config_Abstract|null

Retrieve the Yaf_Config_Abstract instance holding the application configuration passed to the constructor.

Parameters Parameters

Return Values

A Yaf_Config_Abstract instance (a Yaf_Config_Simple object when an array is passed to the constructor, a Yaf_Config_Ini object when an INI file is passed), or null on failure.

Examples

Yaf_Application::getConfig() example

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

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

The above example will output something similar to:

output
Yaf_Config_Simple Object
(
    [_config:protected] => Array
        (
            [application] => Array
                (
                    [directory] => /home/laruence/local/www/htdocs/application
                )

        )

    [_readonly:protected] => 1
)

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