本文整理匯總了PHP中Dwoo_Data::append方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dwoo_Data::append方法的具體用法?PHP Dwoo_Data::append怎麽用?PHP Dwoo_Data::append使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dwoo_Data
的用法示例。
在下文中一共展示了Dwoo_Data::append方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testAppend
public function testAppend()
{
$data = new Dwoo_Data();
$data->assign('var', 'val');
$data->append('var', 'moo');
$this->assertEquals(array('var' => array('val', 'moo')), $data->getData());
$data->assign('var', 'val');
$data->append(array('var' => 'moo', 'var2' => 'bar'));
$this->assertEquals(array('var' => array('val', 'moo'), 'var2' => array('bar')), $data->getData());
}
示例2: testMagicGetSetStuff
public function testMagicGetSetStuff()
{
$data = new Dwoo_Data();
$data->variable = 'val';
$data->append('variable', 'moo');
$this->assertEquals(array('val', 'moo'), $data->get('variable'));
$this->assertEquals(array('val', 'moo'), $data->variable);
$this->assertEquals(true, $data->isAssigned('variable'));
}
示例3: append
public function append($name, $val = null, $merge = false)
{
if (is_array($val)) {
foreach ($val as $k => $v) {
$this->data[$name][$k] = $v;
}
} else {
parent::append($name, $val, $merge);
}
}