本文整理匯總了PHP中ProductCategory::buildTree方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProductCategory::buildTree方法的具體用法?PHP ProductCategory::buildTree怎麽用?PHP ProductCategory::buildTree使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ProductCategory
的用法示例。
在下文中一共展示了ProductCategory::buildTree方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intval
$parents = ProductCategory::getSinglePath($selected_node_id);
//print_r($parents->toArray());
if (count($parents) >= 2) {
$p = $parents[1];
} else {
$p = $parents[0];
}
$selected_parent_slug = $p['slug'];
$hops = intval($select_node['level']) - intval($p['level']);
//echo "level 2:".count($parents).":".$hops;
//print_r($p->toArray());
//$childs = $p->getNode()->getDescendants($hops);
$childs = ProductCategory::getNodeChildrens($p['id'], $hops, $select_node['id']);
}
//build sub into html
$show_sub = ProductCategory::buildTree($childs);
//$show_sub .= ProductCategory::buildTree($next_childs);
} else {
echo "not found";
}
//$current_childs_node = ProductCategory::bll()->getChildByParentSlug_Front($cat_slug);
}
?>
<div class="left_box clearfix">
<h3 class="box_title">
<span>Sản phẩm</span>
</h3>
<div class="box_content clearfix">
<div class="box_txt">
<ul>
<?php