Config_Container::getAttributes
Config_Container::getAttributes() – Get item attributes
Synopsis
require_once 'Config/Container.php';
array Config_Container::getAttributes (
void
)
Description
This method returns an array containing the attributes of this container.
Return value
array
- item's attributes
Note
This function can not be called statically.
Example
Using attribute
<?php
$attributes = array('id' => 'db', 'language' => 'en');
$section =& new Config_Container('section', 'main', null, $attributes);
$section->createDirective('authentication', 'test', array('type' => 'mysql',
'host' => 'localhost'));
echo $section->toString('phparray');
echo $section->toString('xml');
?>
Attributes are set for '@' key with php array type
<?php
$main['@']['id'] = 'db';
$main['@']['language'] = 'en';
$main['authentication']['#'] = 'test';
$main['authentication']['@']['type'] = 'mysql';
$main['authentication']['@']['host'] = 'localhost';
?>
Attributes are set the usual way with xml type
<?xml version="1.0" encoding="ISO-8859-1"?>
<main id="db" language="en">
<authentication type="mysql" host="localhost">
test
</authentication>;
</main>