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


PHP Sections::post_default方法代碼示例

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


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

示例1: lookup

 /**
  * get the id of one section knowing its nick name
  *
  * At the moment following section nick names are used throughout yacs:
  * - 'clicks' - to host external link that are embed into ordinary pages
  * - 'covers' - pages to be displayed as introductory articles at the front page
  * - 'forum' - the coffee machine, for those that are not drinking so much coffee
  * - 'extra_boxes' - page to be displayed as small boxes at the front page
  * - 'letters' - pages sent by e-mail to subscribers
  * - 'menus' - page to be displayed on all pages as the main site menu
  * - 'my_section' - sample section for demonstrattion purpose
  * - 'navigation_boxes' - pages to be displayed as small boxes on all pages
  * - 'partners' - pages dedicated to external partners
  * - 'queries' - pages sent by surfers to submit their queries to the webmaster
  *
  * @param string the nick name looked for
  * @return string either 'section:<id>', or NULL
  *
  * @see articles/populate.php
  * @see articles/review.php
  * @see index.php
  * @see letters/index.php
  * @see letters/new.php
  * @see links/index.php
  * @see links/links.php
  */
 public static function lookup($nick_name)
 {
     global $context;
     // the section already exists
     if ($item = Sections::get($nick_name)) {
         return 'section:' . $item['id'];
     }
     // attempt to create a default item
     Sections::post_default($nick_name);
     // do the check again
     if ($item = Sections::get($nick_name)) {
         return 'section:' . $item['id'];
     }
     // tough luck
     return NULL;
 }
開發者ID:rair,項目名稱:yacs,代碼行數:42,代碼來源:sections.php


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