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_Config_Simple::currentYaf_Config_Simple::__isset>
^Yaf_Config_SimpleLast updated: Mon, 26 Oct 2026

Yaf_Config_Simple::get

(Yaf >=1.0.0)

Yaf_Config_Simple::get — Retrieve a configuration value

Description

public function Yaf_Config_Simple::get(string $name = NULL): mixed

Retrieves a configuration value by name. If name is omitted or null, the configuration object itself is returned.

Parameters

name

The configuration key to retrieve.

Return Values

The value associated with name. Array values are wrapped in a Yaf_Config_Simple object. Returns null if the key does not exist, or the configuration object itself when name is null.

Examples

Example #1 Yaf_Config_Simple::get() example

<?php
$config = new Yaf_Config_Simple([
    'application' => ['name' => 'MyApp'],
    'database'    => ['host' => 'localhost'],
]);

// Array values are wrapped in a Yaf_Config_Simple object
echo $config->get('database')->host, "\n";
echo $config->get('application')->name, "\n";
var_dump($config->get('missing'));
?>

The above example will output something similar to:

localhost
MyApp
NULL

See Also


<Yaf_Config_Simple::currentYaf_Config_Simple::__isset>
^Yaf_Config_SimpleLast updated: Mon, 26 Oct 2026