本文整理汇总了PHP中CategoryModel::MakeTree方法的典型用法代码示例。如果您正苦于以下问题:PHP CategoryModel::MakeTree方法的具体用法?PHP CategoryModel::MakeTree怎么用?PHP CategoryModel::MakeTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CategoryModel
的用法示例。
在下文中一共展示了CategoryModel::MakeTree方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if (!defined('APPLICATION')) {
return;
}
?>
<h1 class="H HomepageTitle"><?php
echo $this->data('Title');
?>
</h1>
<div class="P PageDescription"><?php
echo $this->Description();
?>
</div>
<?php
$this->fireEvent('AfterDescription');
$this->fireEvent('AfterPageTitle');
$Categories = CategoryModel::MakeTree($this->data('Categories'), $this->data('Category', null));
if (c('Vanilla.Categories.DoHeadings')) {
foreach ($Categories as $Category) {
?>
<div id="CategoryGroup-<?php
echo $Category['UrlCode'];
?>
"
class="CategoryGroup <?php
echo val('CssClass', $Category);
?>
">
<h2 class="H"><?php
echo htmlspecialchars($Category['Name']);
?>
</h2>
示例2: t
<?php
$Category = $this->data('Category');
if (!$Category) {
return;
}
$SubCategories = CategoryModel::MakeTree(CategoryModel::categories(), $Category);
if (!$SubCategories) {
return;
}
require_once $this->fetchViewLocation('helper_functions', 'categories', 'vanilla');
?>
<h2 class="ChildCategories-Title Hidden"><?php
echo t('Child Categories');
?>
</h2>
<ul class="DataList ChildCategoryList">
<?php
foreach ($SubCategories as $Row) {
if (!$Row['PermsDiscussionsView'] || $Row['Archived']) {
continue;
}
$Row['Depth'] = 1;
?>
<li id="Category_<?php
echo $Row['CategoryID'];
?>
" class="Item Category">
<div class="ItemContent Category">
<h3 class="CategoryName TitleWrap"><?php
echo anchor(htmlspecialchars($Row['Name']), $Row['Url'], 'Title');
示例3: T
<?php
$SubCategories = CategoryModel::MakeTree($this->Data('Category'));
$SubCategories = array_pop($SubCategories);
if (!$SubCategories || empty($SubCategories['Children'])) {
return;
}
require_once $this->FetchViewLocation('helper_functions', 'categories', 'vanilla');
?>
<h2 class="ChildCategories-Title Hidden"><?php
echo T('Child Categories');
?>
</h2>
<ul class="DataList ChildCategoryList">
<?php
foreach ($SubCategories['Children'] as $Row) {
if (!$Row['PermsDiscussionsView']) {
continue;
}
$Row['Depth'] = 1;
?>
<li id="Category_<?php
echo $Row['CategoryID'];
?>
" class="Item Category">
<div class="ItemContent Category">
<?php
echo Wrap(Anchor($Row['Name'], $Row['Url'], 'Title'), 'h3', array('class' => 'CategoryName TitleWrap'));
?>
<?php
示例4: foreach
<?php
if (!defined('APPLICATION')) {
return;
}
?>
<h1 class="H HomepageTitle"><?php
echo $this->Data('Title');
?>
</h1>
<div class="P PageDescription"><?php
echo $this->Description();
?>
</div>
<?php
$Categories = CategoryModel::MakeTree($this->Data('Categories'), $this->Data('Category', NULL));
if (C('Vanilla.Categories.DoHeadings')) {
foreach ($Categories as $Category) {
?>
<div id="CategoryGroup-<?php
echo $Category['UrlCode'];
?>
" class="CategoryGroup">
<h2 class="H"><?php
echo htmlspecialchars($Category['Name']);
?>
</h2>
<?php
WriteCategoryTable($Category['Children'], 2);
?>
</div>