Config_Container::createSection

Config_Container::createSection() – アイテムにセクションを加える

Synopsis

require_once 'Config/Container.php';

objectConfig_Container::createSection ( string $name , array $attributes = = null , string $where = 'bottom' , object $target = = null )

Description

現在のアイテムが"section"でなければいけません。 createItem() をヘルパー関数として呼びます。

Parameter

string $name

新規セクションの名前。

array array $attributes

セクションの属性。

string $where

新しいアイテムを生成する位置。('top', 'bottom', 'before', 'after')

object $target

$whereで、 'before''after'を指定した場合のみ必要。

Return value

object - 新しいアイテムのリファレンスを返します。

Throws

Possible PEAR_Error values
エラーコード エラー値 意味 解決策
  "    

Note

This function can not be called statically.

Example

createSection() を使用して新しいディレクティブを作成する

<?php
$conf 
=& new Config_Container('section''MAIN');
$dbConf =& $conf->createSection('DB');
$dbConf->createDirective('user''mansion');
?>