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::offsetExistsYaf_Config_Simple::offsetSet>
^Yaf_Config_SimpleLast updated: Mon, 26 Oct 2026

Yaf_Config_Simple::offsetGet

(Yaf >=1.0.0)

Yaf_Config_Simple::offsetGet — Get a value (ArrayAccess)

Description

public function Yaf_Config_Simple::offsetGet(mixed $name): mixed

Retrieves a configuration value by key. This method is an alias of Yaf_Config_Simple::get() and is called when array syntax is used to read a configuration object.

Parameters

name

The configuration key to retrieve.

Return Values

The value associated with name, or null if the key does not exist.

Examples

Example #1 Yaf_Config_Simple::offsetGet() 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['application']->name, "\n";
echo $config['database']['host'], "\n";
var_dump($config['missing']);
?>

The above example will output something similar to:

MyApp
localhost
NULL

See Also


<Yaf_Config_Simple::offsetExistsYaf_Config_Simple::offsetSet>
^Yaf_Config_SimpleLast updated: Mon, 26 Oct 2026