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


PHP Topic::objects方法代碼示例

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


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

示例1: __

        <input type="hidden" name="a" value="search"/>
        <input type="text" name="q" class="search" placeholder="<?php 
echo __('Search our knowledge base');
?>
"/>
        <input type="submit" style="display:none" value="search"/>
        </form>
    </div>
    <div class="content">
        <section>
            <div class="header"><?php 
echo __('Help Topics');
?>
</div>
<?php 
foreach (Topic::objects()->annotate(array('faqs_count' => SqlAggregate::count('faqs')))->filter(array('faqs_count__gt' => 0)) as $t) {
    ?>
        <div><a href="?topicId=<?php 
    echo urlencode($t->getId());
    ?>
"
            ><?php 
    echo $t->getFullName();
    ?>
</a></div>
<?php 
}
?>
        </section>
        <section>
            <div class="header"><?php 
開發者ID:rhcpdu13,項目名稱:osticket-bootstrap-theme,代碼行數:31,代碼來源:kb-search.inc.php

示例2: foreach

?>
</div>
</div>
</div>

<div class="span4">
    <div class="sidebar">

    <div class="content">
        <section>
            <div class="header"><?php 
//echo __('Help Topics');
?>
</div>
<?php 
foreach (Topic::objects()->filter(array('faqs__faq__category__category_id' => $category->getId())) as $t) {
    ?>
        <a href="?topicId=<?php 
    echo urlencode($t->getId());
    ?>
"
            ><?php 
    echo $t->getFullName();
    ?>
</a>
<?php 
}
?>
        </section>
    </div>
    </div>
開發者ID:majklovec,項目名稱:osticket-bootstrap-theme,代碼行數:31,代碼來源:faq-category.inc.php

示例3: __

<?php 
} else {
    echo __('NO FAQs found');
}
?>
</div>
<div class="span4">
    <div class="sidebar">
    <div class="searchbar">
        <form method="get" action="faq.php">
        <input type="hidden" name="a" value="search"/>
        <select name="topicId"  style="width:100%;max-width:100%"
            onchange="javascript:this.form.submit();">
            <option value="">— Browse by Topic —</option>
<?php 
$topics = Topic::objects()->annotate(array('has_faqs' => SqlAggregate::COUNT('faqs')))->filter(array('has_faqs__gt' => 0));
foreach ($topics as $T) {
    ?>
        <option value="<?php 
    echo $T->getId();
    ?>
"><?php 
    echo $T->getFullName();
    ?>
</option>
<?php 
}
?>
        </select>
        </form>
    </div>
開發者ID:rhcpdu13,項目名稱:osticket-bootstrap-theme,代碼行數:31,代碼來源:kb-categories.inc.php


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