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


PHP Section::hasData方法代碼示例

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


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

示例1: makeCriteriaSectionLogic

 function makeCriteriaSectionLogic($section_id)
 {
     require_once 'AMP/Content/Section.inc.php';
     $section = new Section(AMP_Registry::getDbcon(), $section_id);
     if (!$section->hasData()) {
         return 'TRUE';
     }
     $scope = $section->getDisplayCriteria();
     unset($scope['displayable']);
     $value = $this->makeCriteria($scope);
     if ($value) {
         return join(' AND ', $value);
     }
     return 'TRUE';
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:15,代碼來源:Article.inc.php

示例2: Section

 * Redirect to Search Page for invalid page types, i.e. no valid List or Article
 */
if (!($listType || $currentPage->isArticle())) {
    AMP_make_404();
}
/**
 * Redirect to Search Page for unpublished articles unless in preview mode
 */
if (!AMP_DISPLAYMODE_PREVIEW && ($currentArticle =& $currentPage->getArticle())) {
    if (!$currentArticle->isLive()) {
        AMP_make_404();
    }
    //check to make sure parent section is live
    require_once 'AMP/Content/Section.inc.php';
    $currentSection = new Section(AMP_Registry::getDbcon(), $currentArticle->getParent());
    if (!$currentSection->hasData() || !$currentSection->isLive()) {
        if ($currentSection->id != AMP_CONTENT_SECTION_ID_ROOT) {
            AMP_make_404();
        }
    }
    /**
     * Check if specified article is a section header and redirect to that section
     */
    if (AMP_CONTENT_REDIRECT_SECTIONHEADERS_TO_SECTIONS && $currentArticle->getClass() == AMP_CONTENT_CLASS_SECTIONHEADER) {
        if ($currentSection->hasData()) {
            ampredirect($currentSection->getURL());
        }
    }
}
/**
 * Check Section List pages for a redirect in the SectionHeader 
開發者ID:radicalsuz,項目名稱:amp,代碼行數:31,代碼來源:article.php

示例3: setSection

 /**
  * set the Section for use on the current page 
  * 
  * @param   integer   $section_id   The database id of the Section to use 
  * @access  public
  * @since   3.5.3
  * @return  void
  */
 function setSection($section_id)
 {
     require_once 'AMP/Content/Section.inc.php';
     $section = new Section(AMP_Registry::getDbcon(), $section_id);
     if (!$section->hasData()) {
         return false;
     }
     if ($target = $section->getRedirect()) {
         ampredirect($target);
     }
     if (!isset($this->template_id) && ($template = $section->getTemplate())) {
         $this->template_id = $template;
     }
     $this->section =& $section;
     $this->section_id = $section->id;
     $this->_globalizePageVars();
     $this->_globalizeSectionVars($section);
     return true;
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:27,代碼來源:Page.inc.php


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