本文整理汇总了PHP中Tree::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::get方法的具体用法?PHP Tree::get怎么用?PHP Tree::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _tree
private function _tree($upid = 0, $force = 0, $addn = ' ')
{
$and = $force == 1 ? " and upid='{$upid}' " : "";
$list = Lua::get_more("select * from lua_category where systemname='" . SYSNAME . "' {$and} order by vieworder asc,id desc");
$back = array();
if ($list) {
foreach ($list as $v) {
$out[$v['id']] = $v;
}
$tree = new Tree($out);
$tree->field = 'name';
$back = $tree->get($upid, 0, $addn);
}
return $back;
}
示例2: _tree
private function _tree($lua = 'category', $perm)
{
$lua = $lua ? $lua : 'category';
$list = Lua::get_more("select * from lua_" . $lua . " where systemname='" . $perm . "' order by vieworder asc,id desc");
$back = array();
if ($list) {
foreach ($list as $v) {
$out[$v['id']] = $v;
}
$tree = new Tree($out);
$tree->field = 'name';
$back = $tree->get(0, 0, ' ');
}
return $back;
}
示例3: _tree
private function _tree($id)
{
$list = Lua::get_more("select * from lua_model_table where model_id='{$id}'");
$back = array();
if ($list) {
foreach ($list as $v) {
$out[$v['id']] = $v;
}
$tree = new Tree($out);
$back = $tree->get(0, 0, ' ');
}
return $back;
}
示例4: testDataEntry
function testDataEntry()
{
$t1 = new Tree();
$t1->set("/master/test", "xyz");
$this->assertEqual($t1->get("/master/test"), "xyz", "Il valore di /master/test non e' xyz!!");
$t1->merge("/master/first_test", array("first" => "my_first_value"));
$t1->merge("/master/second_test", array("second" => "my_second_value"));
$this->assertEqual($t1->get("/master/first_test/first"), "my_first_value", "Il valore di test non corrisponde!!");
$this->assertEqual($t1->get("/master/second_test/second"), "my_second_value", "Il valore di test non corrisponde!!");
}