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


PHP http::add_url_param方法代碼示例

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


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

示例1: meta_hreflang

 public static function meta_hreflang()
 {
     global $context;
     $meta_hreflang = array();
     $context['hreflang'] = $meta_hreflang;
     $sisters = array();
     //// detect other language for articles or sections
     if (strpos($context['current_item'], 'article') === FALSE && strpos($context['current_item'], 'section') === FALSE) {
         return $meta_hreflang;
     }
     // get the entity
     if ($anchor = Anchors::get($context['current_item'])) {
         // if anchor as a little name
         if ($nick = $anchor->get_nick_name()) {
             $class = $anchor->get_static_group_class();
             $sisters = $class::list_for_name($nick, null, 'raw');
         }
     }
     if (count($sisters)) {
         foreach ($sisters as $page) {
             if ($page['language'] && $page['language'] != 'none') {
                 $url = http::add_url_param($class::get_permalink($page), "lang", $page['language']);
                 $meta_hreflang[] = '<link rel="alternate" hreflang="' . $page['language'] . '" href="' . $url . '" />';
                 // memorize this for page::echo_local_switcher()
                 $context['hreflang'][] = array('lang' => $page['language'], 'url' => $url, 'id' => $page['id']);
             }
         }
     }
     return $meta_hreflang;
 }
開發者ID:rair,項目名稱:yacs,代碼行數:30,代碼來源:page.php

示例2: redirect

 /**
  * jump to another web page
  *
  * This function never returns.
  *
  * @param string the target full web address
  */
 public static function redirect($reference)
 {
     global $render_overlaid;
     // stay overlaid if it was asked
     if ($render_overlaid) {
         // stop redirect if param follow_up set to 'close'
         if (isset($_REQUEST['follow_up']) && $_REQUEST['follow_up'] === 'close') {
             exit('job done');
         }
         // add overlaid param
         $reference = http::add_url_param($reference, "overlaid", "Y");
     }
     // the actual redirection directive
     Safe::header('Location: ' . $reference);
     // a message for human beings
     if (!is_callable(array('i18n', 's'))) {
         exit;
     }
     exit(sprintf(i18n::s('Redirecting to %s'), '<a href="' . $reference . '">' . $reference . '</a>'));
 }
開發者ID:rair,項目名稱:yacs,代碼行數:27,代碼來源:safe.php


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