本文整理匯總了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!!");
}