本文整理匯總了PHP中category::get_category_tree_data方法的典型用法代碼示例。如果您正苦於以下問題:PHP category::get_category_tree_data方法的具體用法?PHP category::get_category_tree_data怎麽用?PHP category::get_category_tree_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類category
的用法示例。
在下文中一共展示了category::get_category_tree_data方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: tree
/**
* Hack to return category tree via API
* Avoids building the tree on the client side
*/
public function tree()
{
echo json_encode(category::get_category_tree_data(FALSE, $this->admin));
}
示例2: foreach
<?php
echo html::link($css, 'stylesheet', 'text/css');
foreach ($js as $script) {
$script = url::base() . $script;
echo "<script type=\"text/javascript\" src=\"{$script}\"></script>\n";
}
?>
<script>
var baseURL = '<?php
echo url::base();
?>
';
window.baseURL = baseURL;
var categoryTree = <?php
echo json_encode(category::get_category_tree_data(FALSE, $this->auth->admin_access()));
?>
$(function() {
var UshahidiApp = new AppRouter(
{
container : $('#content .bg'),
baseURL : baseURL,
categoryTree : categoryTree
});
window.app = UshahidiApp;
Backbone.history.start();
});
</script>
</head>
<body>