加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用DHTMLX Tree 输出(树状结构)

发布时间:2020-12-15 23:14:09 所属栏目:百科 来源:网络整理
导读:ob_end_clean(); // 关闭缓存区error_reporting(E_ALL ^ E_NOTICE);$select = 0;header("Content-type:text/xml");$xml = '?xml version="1.0" encoding="UTF-8"?';if ($uid == 0) {$tid = 0;} else {$tid = $id;}$xml .= 'tree id ="' . $tid . '"';if (! e
ob_end_clean(); // 关闭缓存区
error_reporting(E_ALL ^ E_NOTICE);
$select = 0;
header("Content-type:text/xml");
$xml = '<?xml version="1.0" encoding="UTF-8"?>';
if ($uid == 0) {
	$tid = 0;
} else {
	$tid = $id;
}
$xml .= '<tree id ="' . $tid . '">';
if (! empty($cates)) {
	foreach ($cates as $k => $v) {
		$child = $result->getChildNodeBy($v['title']);
		if (! empty($child)) {
			foreach ($child as $key => $obj) {
				$xml .= '<item  child="1" text="' . $v['title'] .
					'" id="' . $v['id'] . '"  >';
		}
		} else {
			if ($k == 0) {
				$xml .= '<item   text="' . $v['title'] . '" id="' .
								 $v['id'] . '"  select="1" >';
			} else {
				$xml .= '<item   text="' . $v['title'] . '" id="' .
								 $v['id'] . '"   >';
			}
		}
		$xml .= "<userdata name='parent_id'>" . $v['parent_id'] .
						 "</userdata>";
		$xml .= '</item>';
	}
}
$xml .= "</tree>";
return $xml;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读