本文整理匯總了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']);
}
示例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';
示例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);
}