Config_Container::getAttributes()

Config_Container::getAttributes() -- アイテムの総ての属性を取得する

概要

require_once 'Config/Container.php';

array Config_Container::getAttributes (void)

説明

この関数は、このコンテナーの総ての属性を配列で返します。

返り値

array - アイテムの総ての属性を返します。

注意

この関数は、スタティックにコールする ことはできません。

例 31-1属性の使用法


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

例 31-2総ての属性を'@'キーとPHP配列タイプで設定する

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

例 31-3xmlタイプで通常の方法を用いて総ての属性をで設定する

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