当前位置: 首页>>代码示例>>PHP>>正文


PHP CategoryModel::MakeTree方法代码示例

本文整理汇总了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>
开发者ID:karanjitsingh,项目名称:iecse-forum,代码行数:31,代码来源:table.php

示例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');
开发者ID:caidongyun,项目名称:vanilla,代码行数:31,代码来源:subtree.php

示例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 
开发者ID:rnovino,项目名称:Garden,代码行数:31,代码来源:subtree.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>
开发者ID:elpum,项目名称:TgaForumBundle,代码行数:31,代码来源:table.php


注:本文中的CategoryModel::MakeTree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。