本文整理汇总了PHP中Home::getcatbdd方法的典型用法代码示例。如果您正苦于以下问题:PHP Home::getcatbdd方法的具体用法?PHP Home::getcatbdd怎么用?PHP Home::getcatbdd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Home
的用法示例。
在下文中一共展示了Home::getcatbdd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCat
public function setCat($smarty, $tpl, $params, $DB)
{
$home = new Home($DB);
$cat = $home->getcat();
$catprog = $home->getcatprog();
$catweb = $home->getcatweb();
$catreseau = $home->getcatreseau();
$catbdd = $home->getcatbdd();
$catmobiles = $home->getcatmobiles();
$catsystemes = $home->getcatsystemes();
$tabcatprog = array();
$tabcatweb = array();
$tabcatreseau = array();
$tabcatbdd = array();
$tabcatmobiles = array();
$tabcatsystemes = array();
// Sous-catégories programmation
if ($catprog) {
foreach ($catprog as $key => $value) {
if (!isset($tabcatprog[$catprog[$key]['idCatPosts']])) {
$tabcatprog[$catprog[$key]['idCatPosts']] = array();
}
array_push($tabcatprog[$catprog[$key]['idCatPosts']], $catprog[$key]['nomCatPosts'], $catprog[$key]['idCat']);
}
}
// Sous-catégories dév.web
if ($catweb) {
foreach ($catweb as $key => $value) {
if (!isset($tabcatweb[$catweb[$key]['idCatPosts']])) {
$tabcatweb[$catweb[$key]['idCatPosts']] = array();
}
array_push($tabcatweb[$catweb[$key]['idCatPosts']], $catweb[$key]['nomCatPosts'], $catweb[$key]['idCat']);
}
}
// Sous-catégories réseau
if ($catreseau) {
foreach ($catreseau as $key => $value) {
if (!isset($tabcatreseau[$catreseau[$key]['idCatPosts']])) {
$tabcatreseau[$catreseau[$key]['idCatPosts']] = array();
}
array_push($tabcatreseau[$catreseau[$key]['idCatPosts']], $catreseau[$key]['nomCatPosts'], $catreseau[$key]['idCat']);
}
}
// Sous-catégories bdd
if ($catbdd) {
foreach ($catbdd as $key => $value) {
if (!isset($tabcatbdd[$catbdd[$key]['idCatPosts']])) {
$tabcatbdd[$catbdd[$key]['idCatPosts']] = array();
}
array_push($tabcatbdd[$catbdd[$key]['idCatPosts']], $catbdd[$key]['nomCatPosts'], $catbdd[$key]['idCat']);
}
}
// Sous-catégories mobiles
if ($catmobiles) {
foreach ($catmobiles as $key => $value) {
if (!isset($tabcatmobiles[$catmobiles[$key]['idCatPosts']])) {
$tabcatmobiles[$catmobiles[$key]['idCatPosts']] = array();
}
array_push($tabcatmobiles[$catmobiles[$key]['idCatPosts']], $catmobiles[$key]['nomCatPosts'], $catmobiles[$key]['idCat']);
}
}
// Sous-catégories systèmes
if ($catsystemes) {
foreach ($catsystemes as $key => $value) {
if (!isset($tabcatsystemes[$catsystemes[$key]['idCatPosts']])) {
$tabcatsystemes[$catsystemes[$key]['idCatPosts']] = array();
}
array_push($tabcatsystemes[$catsystemes[$key]['idCatPosts']], $catsystemes[$key]['nomCatPosts'], $catsystemes[$key]['idCat']);
}
}
$smarty->assign('tabcatprog', $tabcatprog);
$smarty->assign('tabcatweb', $tabcatweb);
$smarty->assign('tabcatreseau', $tabcatreseau);
$smarty->assign('tabcatbdd', $tabcatbdd);
$smarty->assign('tabcatmobiles', $tabcatmobiles);
$smarty->assign('tabcatsystemes', $tabcatsystemes);
}