Config_Container::createSection()
Config_Container::createSection() -- アイテムにセクションを加える
概要
require_once 'Config/Container.php'; |
objectConfig_Container::createSection (string $name [, array $attributes = NULL [, string $where = 'bottom' [, object $target = NULL]]])
説明
現在のアイテムが"section"でなければいけません。
createItem()
をヘルパー関数として呼びます。
パラメータ
- string
$name
新規セクションの名前。
- array
array $attributes
セクションの属性。
- string
$where
新しいアイテムを生成する位置。('top',
'bottom',
'before', 'after')
- object
$target
$whereで、
'before'か
'after'を指定した場合のみ必要。
返り値
object - 新しいアイテムのリファレンスを返します。
注意
この関数は、スタティックにコールする
ことはできません。
例
例 31-1createSection()
を使用して新しいディレクティブを作成する
<?php
$conf =& new Config_Container('section', 'MAIN');
$dbConf =& $conf->createSection('DB');
$dbConf->createDirective('user', 'mansion');
?>
|
|