本文整理匯總了PHP中Home::getcatprog方法的典型用法代碼示例。如果您正苦於以下問題:PHP Home::getcatprog方法的具體用法?PHP Home::getcatprog怎麽用?PHP Home::getcatprog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Home
的用法示例。
在下文中一共展示了Home::getcatprog方法的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);
}