當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CTag::getObjects方法代碼示例

本文整理匯總了PHP中CTag::getObjects方法的典型用法代碼示例。如果您正苦於以下問題:PHP CTag::getObjects方法的具體用法?PHP CTag::getObjects怎麽用?PHP CTag::getObjects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CTag的用法示例。


在下文中一共展示了CTag::getObjects方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

} elseif (strpos($tag_id, "none") === 0) {
    $parts = explode("-", $tag_id);
    $object_class = $parts[1];
    $tag->object_class = $object_class;
    $object = new $object_class();
    $where["tag_item_id"] = "IS NULL";
    $ljoin = array("tag_item" => "tag_item.object_id = {$object->_spec->table}.{$object->_spec->key} AND tag_item.object_class = '{$object_class}'");
    if (!$keywords) {
        $keywords = "%";
    }
    $objects = $object->seek($keywords, $where, 10000, true, $ljoin);
    $count_children = $object->_totalSeek;
} else {
    $tag->load($tag_id);
    $count_children = $tag->countChildren();
    $objects = $tag->getObjects($keywords);
    // filter by group_id
    if ($group_id) {
        foreach ($objects as $_id => $_object) {
            if ($_object->group_id && $_object->group_id != $group_id) {
                unset($objects[$_id]);
            }
        }
    }
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("objects", $objects);
$smarty->assign("columns", $columns);
$smarty->assign("insertion", $insertion);
$smarty->assign("count_children", $count_children);
開發者ID:fbone,項目名稱:mediboard4,代碼行數:31,代碼來源:ajax_list_objects_by_tag.php


注:本文中的CTag::getObjects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。