Config_Container::getAttributes()

Config_Container::getAttributes() -- 获得多个条目的属性值

大纲

require_once 'Config/Container.php';

数组 Config_Container::getAttributes (void)

基本描述

该方法返回一个包含多个包容器属性的数组。

返回值

数组 - 条目的属性值。

注意

该函数不能被静态调用。

例子

例子 24-1. Using attribute

$attributes = 数组 ('id' => 'db', 'language' => 'en');
     $section =& new Config_Container('section', 'main', null, $attributes);
     $section->createDirective('authentication', 'test', 数组 ('type' => 'mysql',
     'host' => 'localhost'));

     echo $section->toString('phparray');
     echo $section->toString('xml');

例子 24-2. 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';
?>

例子 24-3. 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>