Config_Container::getAttributes

Config_Container::getAttributes() – Récupère les attributs d'un élément

Synopsis

require_once 'Config/Container.php';

tableau Config_Container::getAttributes ( ( void )

Description

Cette Méthode retourne un tableau contenant les attributs de ce conteneur.

Return value

tableau - attributs de l'élément

Note

This function can not be called statically.

Example

Utilisation des attributs

<?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');
?>

Les attributs sont définis pour la clé '@' avec un tableau PHP


<?php
$main['@']['id'] = 'db';
$main['@']['language'] = 'en';
$main['authentication']['#'] = 'test';
$main['authentication']['@']['type'] = 'mysql';
$main['authentication']['@']['host'] = 'localhost';
?>

Les attributs sont définis sous la forme XML


<?xml version="1.0" encoding="ISO-8859-1"?>
<main id="db" language="en">
 <authentication type="mysql" host="localhost">
  test
 </authentication>;
</main>