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


PHP categories::getAllWithChilds方法代码示例

本文整理汇总了PHP中categories::getAllWithChilds方法的典型用法代码示例。如果您正苦于以下问题:PHP categories::getAllWithChilds方法的具体用法?PHP categories::getAllWithChilds怎么用?PHP categories::getAllWithChilds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在categories的用法示例。


在下文中一共展示了categories::getAllWithChilds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pages

 #保存推荐人至session
 if (isset($_GET['ref'])) {
     $_SESSION['temp']['referal'] = $_GET['ref'];
 }
 #加载页面至菜单
 require_once ROOT_PATH . '/apps/pages/models/pages.class.php';
 $pagesClass = new pages();
 $menuPages = $pagesClass->getAll(0, 0, " `visible` = 'true' AND `menu` = 'true' ", true);
 abr('menuPages', $menuPages);
 $footerPages = $pagesClass->getAll(0, 0, " `visible` = 'true' AND `footer` = 'true' ", true);
 abr('footerPages', $footerPages);
 #加载主分类
 require_once ROOT_PATH . '/apps/categories/models/categories.class.php';
 $categoriesClass = new categories();
 $mainCategories = $categoriesClass->getAll(0, 0, " `visible` = 'true' AND `sub_of` = '0' ");
 $allCats = $categoriesClass->getAllWithChilds(0, '`visible` = \'true\'');
 abr('mainCategories', $allCats[0]);
 unset($allCats[0]);
 abr('allCats', $allCats);
 //abr('mainCategories', $mainCategories);
 #加载计数器
 require_once ROOT_PATH . '/apps/items/models/items.class.php';
 $itemsClass = new items();
 abr('itemsCount', $itemsClass->getItemsCount());
 require_once ROOT_PATH . '/apps/users/models/users.class.php';
 $usersClass = new users();
 abr('usersCount', $usersClass->getUsersCount(" `status` = 'activate' "));
 #更新用户数据
 if (check_login_bool()) {
     $_SESSION['user'] = $usersClass->get($_SESSION['user']['user_id']);
 }
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:index.php

示例2: refresh

// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(ROOT_PATH . "/apps/" . $_GET['m'] . "/admin/add.php");
_setTitle($langArray['edit']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'INVALID ID', 'error');
}
if (!isset($_GET['p'])) {
    $_GET['p'] = '';
}
$cms = new categories();
if (isset($_POST['edit'])) {
    $status = $cms->edit($_GET['id']);
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=list&sub_of=" . $_GET['sub_of'] . "&p=" . $_GET['p'], $langArray['edit_complete']);
    }
} else {
    $_POST = $cms->get($_GET['id']);
}
$pagesArr = $cms->getAllWithChilds($_GET['id']);
$select = $cms->generateSelect($pagesArr, $_POST['sub_of']);
abr('select', $select);
if ($_GET['sub_of'] != 0) {
    $pdata = $cms->get($_GET['sub_of']);
    abr('pdata', $pdata);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:edit.php

示例3: categories

<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['browse_categories_setTitle']);
$categoryID = get_id(1);
if (is_numeric($categoryID) || $categoryID == 'all') {
    require_once ROOT_PATH . '/apps/categories/models/categories.class.php';
    $categoriesClass = new categories();
    $categories = $categoriesClass->getAll();
    abr('categories', $categories);
} else {
    $allCategories = $categoriesClass->getAllWithChilds(0, " `visible` = 'true' ");
    $categoriesbrowseList = $categoriesClass->generatebrowseList($allCategories);
    abr('categoriesbrowseList', $categoriesbrowseList);
}
开发者ID:yunsite,项目名称:demila,代码行数:24,代码来源:browse.php


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