本文整理汇总了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;
}
示例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>'));
}