当前位置: 首页>>代码示例>>PHP>>正文


PHP Url::absolute方法代码示例

本文整理汇总了PHP中Url::absolute方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::absolute方法的具体用法?PHP Url::absolute怎么用?PHP Url::absolute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Url的用法示例。


在下文中一共展示了Url::absolute方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Url

 function set_link($value)
 {
     if (!of_class($value, URL__CLASS)) {
         $value = new Url($value);
     }
     $this->link = $value->absolute();
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:7,代码来源:feed_data.class.php

示例2: Url

 function test_anchors()
 {
     $url = new Url('/news/../admin/menus/../updates/../../wiki/wiki.php#welcome');
     self::assertEquals('/wiki/wiki.php#welcome', $url->relative());
     $url = new Url('#welcome');
     self::assertEquals('#welcome', $url->absolute());
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:UrlTest.php

示例3: import

 function get_url($relative = false)
 {
     import('util/url');
     $url = new Url('/syndication.php?m=' . $this->module_id . '&cat=' . $this->category . '&name=' . $this->name);
     if ($relative) {
         return $url->relative();
     }
     return $url->absolute();
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:9,代码来源:feed_menu.class.php

示例4: Url

 function _get_url($string_url, $compute_relative_url = true)
 {
     $url = new Url($string_url);
     if ($compute_relative_url) {
         return $url->relative();
     } else {
         return $url->absolute();
     }
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:9,代码来源:links_menu_element.class.php

示例5: execute

 public function execute(HTTPRequestCustom $request)
 {
     $status = 200;
     $url = '';
     $image_to_check = $request->get_string('image', '');
     $image = new Url($image_to_check);
     if ($image_to_check) {
         $file_headers = get_headers($image->absolute(), true);
         if (is_array($file_headers)) {
             if (preg_match('/^HTTP\\/[12]\\.[01] (\\d\\d\\d)/', $file_headers[0], $matches)) {
                 $status = (int) $matches[1];
             }
         }
     }
     if ($status == 200) {
         $url = $image->absolute();
     }
     return new JSONResponse(array('url' => $url));
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:19,代码来源:AjaxImagePreviewController.class.php

示例6: url_is_valid

 public function url_is_valid(FormField $field)
 {
     $status = 200;
     $url = new Url($field->get_value());
     $file_headers = get_headers($url->absolute(), true);
     if (is_array($file_headers)) {
         if (preg_match('/^HTTP\\/[12]\\.[01] (\\d\\d\\d)/', $file_headers[0], $matches)) {
             $status = (int) $matches[1];
         }
     }
     return $status == 200;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:FormFieldConstraintUrlExists.class.php

示例7: execute

 public function execute(HTTPRequestCustom $request)
 {
     $status = 200;
     $url_to_check = $request->get_value('url_to_check', '');
     if ($url_to_check) {
         $url = new Url($url_to_check);
         $file_headers = get_headers($url->absolute(), true);
         if (is_array($file_headers)) {
             if (preg_match('/^HTTP\\/[12]\\.[01] (\\d\\d\\d)/', $file_headers[0], $matches)) {
                 $status = (int) $matches[1];
             }
         }
     }
     return new JSONResponse(array('status' => $status));
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:15,代码来源:AjaxUrlValidationController.class.php

示例8: set_link

 /**
  * @desc Sets the feed item link
  * @param mixed $value a string url or an Url object
  */
 public function set_link($value)
 {
     if (!$value instanceof Url) {
         $value = new Url($value);
     }
     $this->link = $value->absolute();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:FeedItem.class.php

示例9: to_absolute

 /**
  * @desc Returns an absolute url
  * @param mixed $url the url representation. Could be a string or an Url object
  * @return string an absolute url
  */
 public static function to_absolute($url)
 {
     if (!$url instanceof Url) {
         $url = new Url($url);
     }
     return $url->absolute();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:Url.class.php

示例10: second_parse_url

 /**
  * @desc Second parses relative urls to absolute urls.
  * @param string $url Url to second parse
  * @return string The second parsed url.
  * @see Url
  */
 public static function second_parse_url($url)
 {
     $Url = new Url($url);
     return $Url->absolute();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:FormatingHelper.class.php

示例11: second_parse_url

function second_parse_url(&$url)
{
    import('util/url');
    $Url = new Url($url);
    return $Url->absolute();
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:6,代码来源:functions.inc.php

示例12: absolute_url

 public function absolute_url(Url $url)
 {
     return $url->absolute();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:4,代码来源:TemplateFunctions.class.php

示例13: Url

 static function _convert_url_to_absolute($url_params)
 {
     $url = new Url($url_params[2]);
     $url_params[2] = $url->absolute();
     return $url_params[1] . $url_params[2] . $url_params[3];
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:6,代码来源:url.class.php

示例14: retrieve

 $start = retrieve(POST, 'start', 0, TSTRING_UNCHANGE);
 $start_hour = retrieve(POST, 'start_hour', 0, TSTRING_UNCHANGE);
 $start_min = retrieve(POST, 'start_min', 0, TSTRING_UNCHANGE);
 $end = retrieve(POST, 'end', 0, TSTRING_UNCHANGE);
 $end_hour = retrieve(POST, 'end_hour', 0, TSTRING_UNCHANGE);
 $end_min = retrieve(POST, 'end_min', 0, TSTRING_UNCHANGE);
 $current_date = retrieve(POST, 'current_date', '', TSTRING_UNCHANGE);
 $current_hour = retrieve(POST, 'current_hour', 0, TSTRING_UNCHANGE);
 $current_min = retrieve(POST, 'current_min', 0, TSTRING_UNCHANGE);
 $start_timestamp = strtotimestamp($start, $LANG['date_format_short']);
 $end_timestamp = strtotimestamp($end, $LANG['date_format_short']);
 $current_date_timestamp = strtotimestamp($current_date, $LANG['date_format_short']);
 $img_displays = '';
 if (!empty($img)) {
     $img_url = new Url(stripslashes($img));
     $img_displays = '<img src="' . $img_url->absolute() . '" alt="' . stripslashes($alt) . '" title="' . stripslashes($alt) . '" class="img_right" />';
     $img_preview = '<img src="' . $img_url->absolute() . '" alt="' . stripslashes($alt) . '" title="' . stripslashes($alt) . '" />';
 }
 $Template->assign_block_vars('news', array('TITLE' => $title, 'PREVIEWED_CONTENTS' => second_parse(stripslashes($contents)), 'PREVIEWED_EXTEND_CONTENTS' => second_parse(stripslashes($extend_contents)), 'PSEUDO' => $User->get_attribute('login'), 'U_USER_ID' => url('.php?id=' . $User->get_attribute('user_id'), '-' . $User->get_attribute('user_id') . '.php'), 'IMG' => $img_displays, 'DATE' => gmdate_format('date_format_short')));
 $i = 0;
 $result = $Sql->query_while("SELECT id, name FROM " . PREFIX . "news_cat", __LINE__, __FILE__);
 while ($row = $Sql->fetch_assoc($result)) {
     $selected = $row['id'] == $idcat ? 'selected="selected"' : '';
     $Template->assign_block_vars('select', array('CAT' => '<option value="' . $row['id'] . '" ' . $selected . '>' . $row['name'] . '</option>'));
     $i++;
 }
 $Sql->query_close($result);
 if ($i == 0) {
     $Errorh->handler($LANG['require_cat_create'], E_USER_WARNING);
 }
 $Template->assign_vars(array('MODULE_DATA_PATH' => $Template->get_module_data_path('news'), 'TOKEN' => $Session->get_token(), 'NEWS_TITLE' => $title, 'CONTENTS' => retrieve(POST, 'contents', '', TSTRING_UNCHANGE), 'EXTEND_CONTENTS' => retrieve(POST, 'extend_contents', '', TSTRING_UNCHANGE), 'IMG_PREVIEW' => !empty($img) ? $img_preview : $LANG['no_img'], 'IMG' => $img, 'ALT' => stripslashes($alt), 'START' => $start, 'START_HOUR' => !empty($start_hour) ? $start_hour : '', 'START_MIN' => !empty($start_min) ? $start_min : '', 'END' => $end, 'END_HOUR' => !empty($end_hour) ? $end_hour : '', 'END_MIN' => !empty($end_min) ? $end_min : '', 'CURRENT_DATE' => $current_date, 'CURRENT_HOUR' => !empty($current_hour) ? $current_hour : '', 'CURRENT_MIN' => !empty($current_min) ? $current_min : '', 'DAY_RELEASE_S' => !empty($start_timestamp) ? gmdate_format('d', $start_timestamp) : '', 'MONTH_RELEASE_S' => !empty($start_timestamp) ? gmdate_format('m', $start_timestamp) : '', 'YEAR_RELEASE_S' => !empty($start_timestamp) ? gmdate_format('Y', $start_timestamp) : '', 'DAY_RELEASE_E' => !empty($end_timestamp) ? gmdate_format('d', $end_timestamp) : '', 'MONTH_RELEASE_E' => !empty($end_timestamp) ? gmdate_format('m', $end_timestamp) : '', 'YEAR_RELEASE_E' => !empty($end_timestamp) ? gmdate_format('Y', $end_timestamp) : '', 'DAY_DATE' => !empty($current_date_timestamp) ? gmdate_format('d', $current_date_timestamp) : '', 'MONTH_DATE' => !empty($current_date_timestamp) ? gmdate_format('m', $current_date_timestamp) : '', 'YEAR_DATE' => !empty($current_date_timestamp) ? gmdate_format('Y', $current_date_timestamp) : '', 'VISIBLE_WAITING' => $get_visible == 2 ? 'checked="checked"' : '', 'VISIBLE_ENABLED' => $get_visible == 1 ? 'checked="checked"' : '', 'VISIBLE_UNAPROB' => $get_visible == 0 ? 'checked="checked"' : '', 'KERNEL_EDITOR' => display_editor(), 'KERNEL_EDITOR_EXTEND' => display_editor('extend_contents'), 'L_NEWS_MANAGEMENT' => $LANG['news_management'], 'L_ADD_NEWS' => $LANG['add_news'], 'L_CONFIG_NEWS' => $LANG['configuration_news'], 'L_CAT_NEWS' => $LANG['category_news'], 'L_IMG_MANAGEMENT' => $LANG['img_management'], 'L_PREVIEW_IMG' => $LANG['preview_image'], 'L_PREVIEW_IMG_EXPLAIN' => $LANG['preview_image_explain'], 'L_IMG_LINK' => $LANG['img_link'], 'L_IMG_DESC' => $LANG['img_desc'], 'L_BB_UPLOAD' => $LANG['bb_upload'], 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_REQUIRE_CAT' => $LANG['require_cat'], 'L_PREVIEW' => $LANG['preview'], 'L_COM' => $LANG['com'], 'L_ON' => $LANG['on'], 'L_REQUIRE' => $LANG['require'], 'L_TITLE' => $LANG['title'], 'L_NEWS_DATE' => $LANG['news_date'], 'L_AT' => $LANG['at'], 'L_UNIT_HOUR' => $LANG['unit_hour'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_TEXT' => $LANG['content'], 'L_EXTENDED_NEWS' => $LANG['extended_news'], 'L_CATEGORY' => $LANG['category'], 'L_UNTIL' => $LANG['until'], 'L_RELEASE_DATE' => $LANG['release_date'], 'L_IMMEDIATE' => $LANG['immediate'], 'L_UNAPROB' => $LANG['unaprob'], 'L_SUBMIT' => $LANG['submit'], 'L_RESET' => $LANG['reset']));
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:admin_news_add.php


注:本文中的Url::absolute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。