Config_Container::createDirective()

Config_Container::createDirective() -- 向一个条目添加directive

大纲

require_once 'Config/Container.php';

对象 Config_Container::createDirective (字符串 $name, 字符串 $content [, mixed $attributes = NULL [, 字符串 $where = 'bottom' [, mixed $target = NULL]]])

基本描述

当前条目必须作为一个节存在。它是 createItem() 函数的一个辅助方法。

参数

字符串 $name

新 directive 的名字。

字符串 $content

新 directive 的内容。

mixed $attributes

Directive 的属性。

字符串 $where

创建的位置(一般为'top', 'bottom', 'before', 'after')。

对象 $target

仅当$where参数使用'before'或'after'时使用。

返回值

对象 - 新条目类型。

Throws

表 24-1. 可能出现的 PEAR_Error 值

Error codeError valueMeaningSolution
 ""  

注意

该函数不能被静态调用。

例子

例子 24-1. Create a new directive using createDirective()

$section =& new Config_Container('section', 'conf');
$section->createDirective('user', 'mansion');