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