• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getUrl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP getUrl函数的具体用法?PHP getUrl怎么用?PHP getUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: printBtn

 /**
  * @brief 버튼을 출력함
  **/
 function printBtn()
 {
     if ($this->nextUrl) {
         $url = $this->nextUrl;
         printf('<do type="vnd.next" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
     }
     if ($this->prevUrl) {
         $url = $this->prevUrl;
         printf('<do type="vnd.prev" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
     }
     // 기타 해당사항 없는 버튼 출력 담당 (array로 전달) type??
     if ($this->etcBtn) {
         if (is_array($this->etcBtn)) {
             foreach ($this->etcBtn as $key => $val) {
                 printf('<do type="vnd.btn%s" label="%s"><go href="%s"/></do>%s', $key, $val['text'], $val['url'], "\n");
             }
         }
     }
     // 언어선택
     if (!parent::isLangChange()) {
         $url = getUrl('', 'lcm', '1', 'sel_lang', Context::getLangType(), 'return_uri', Context::get('current_url'));
         printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', 'Language : ' . Context::getLang('select_lang'), $url, "\n");
     } else {
         printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n");
     }
     if ($this->homeUrl) {
         $url = $this->homeUrl;
         printf('<do type="access" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
     }
     if ($this->upperUrl) {
         $url = $this->upperUrl;
         printf('<do type="vnd.up" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
     }
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:37,代码来源:wml.class.php


示例2: createUrl

 /**
  * createUrl creates the tinyUrl for requested Url
  * @params $url string, requested URL to be shorted
  * @return string
  **/
 public function createUrl($url)
 {
     try {
         $urlObj = $this->getUrl($url);
     } catch (Exception $e) {
         $response = array("status" => 'error', "message" => "An error occured, Please try again later", "error_code" => $e->getCode());
         return json_encode($response);
     }
     if ($urlObj) {
         $response = array("status" => 'success', "url" => $urlObj["url"], "tiny_url" => getUrl($urlObj["tiny"]));
         return json_encode($response);
     }
     do {
         try {
             $newTinyUrl = $this->createTinyUrl();
             $urlCheck = $this->getTinyUrl($newTinyUrl, true);
         } catch (Exception $e) {
             $response = array("status" => 'error', "message" => "An error occured, Please try again later", "error_code" => $e->getCode());
             return json_encode($response);
         }
     } while ($urlCheck == true);
     try {
         $this->registerUrl($url, $newTinyUrl);
         $response = array("status" => 'success', "url" => $url, "tiny_url" => getUrl($newTinyUrl));
         return json_encode($response);
     } catch (Exception $e) {
         $response = array("status" => 'error', "message" => $e->getMessage(), "error_code" => $e->getCode());
         return json_encode($response);
     }
 }
开发者ID:aderopoa,项目名称:shortenedurl,代码行数:35,代码来源:Tiny.php


示例3: triggerRssUrlInsert

 /**
  * Check whether to use RSS rss url by adding
  *
  * @return Object
  */
 function triggerRssUrlInsert()
 {
     $oModuleModel = getModel('module');
     $total_config = $oModuleModel->getModuleConfig('rss');
     $current_module_srl = Context::get('module_srl');
     $site_module_info = Context::get('site_module_info');
     if (is_array($current_module_srl)) {
         unset($current_module_srl);
     }
     if (!$current_module_srl) {
         $current_module_info = Context::get('current_module_info');
         $current_module_srl = $current_module_info->module_srl;
     }
     if (!$current_module_srl) {
         return new Object();
     }
     // Imported rss settings of the selected module
     $oRssModel = getModel('rss');
     $rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
     if ($rss_config->open_rss != 'N') {
         Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss'));
         Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom'));
     }
     if (Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') {
         if (Context::isAllowRewrite() && !Context::get('vid')) {
             $request_uri = Context::getRequestUri();
             Context::set('general_rss_url', $request_uri . 'rss');
             Context::set('general_atom_url', $request_uri . 'atom');
         } else {
             Context::set('general_rss_url', getUrl('', 'module', 'rss', 'act', 'rss'));
             Context::set('general_atom_url', getUrl('', 'module', 'rss', 'act', 'atom'));
         }
     }
     return new Object();
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:40,代码来源:rss.controller.php


示例4: principal

function principal()
{
    if (validarUsuarioLoggeado()) {
        if (validarAdministradorPrivado()) {
            $offset = 0;
            $numRows = 6;
            $pagina = 1;
            if (isset($_GET['p'])) {
                if (is_numeric($_GET['p'])) {
                    $pagina = intval($_GET['p']);
                    $offset = $numRows * ($pagina - 1);
                }
            }
            require_once 'modulos/grupos/modelos/grupoModelo.php';
            $res = getGrupos($offset, $numRows);
            $grupos = $res['grupos'];
            $numGrupos = $res['n'];
            $maxPagina = ceil($numGrupos / $numRows);
            if ($pagina != 1 && $pagina > $maxPagina) {
                redirect("/grupos&p=" . $maxPagina);
            }
            clearBreadCrumbs();
            pushBreadCrumb(getUrl(), "Lista de grupos", true);
            require_once 'modulos/grupos/vistas/principal.php';
        } else {
            goToIndex();
        }
    } else {
        goToIndex();
    }
}
开发者ID:netor27,项目名称:UnovaPrivado,代码行数:31,代码来源:grupoControlador.php


示例5: importShuttlePositions

function importShuttlePositions()
{
    $url = "http://shuttles.rpi.edu/vehicles/current.js";
    //mysql_query("TRUNCATE stops"); mysql_query("TRUNCATE stop_routes"); mysql_query("TRUNCATE routes"); mysql_query("TRUNCATE route_coords");
    $data = json_decode(getUrl($url));
    print_r($data);
    foreach ($data as $current_stat_item) {
        if ($current_stat_item->vehicle) {
            $shuttle_status = $current_stat_item->vehicle;
            /* update 'shuttle' table */
            if (Shuttle::get($shuttle_status->id)) {
                Shuttle::update($shuttle_status->id, $shuttle_status);
            } else {
                Shuttle::insert($shuttle_status);
            }
            if ($shuttle_status->latest_position) {
                /* update 'shuttle_coords' table */
                echo "inserting into shuttleCoords";
                echo ShuttleCoords::insert($shuttle_status->id, $shuttle_status->latest_position);
            }
        }
    }
    ShuttleCoords::deleteOlderThan(2);
    /* delete history over 2 days old */
}
开发者ID:nagyistoce,项目名称:Shuttle-Tracker,代码行数:25,代码来源:import_data.php


示例6: printBtn

 /**
  * @brief Button to output
  **/
 function printBtn()
 {
     if ($this->nextUrl) {
         $url = $this->nextUrl;
         printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
     }
     if ($this->prevUrl) {
         $url = $this->prevUrl;
         printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
     }
     // Select Language
     if (!parent::isLangChange()) {
         $url = getUrl('', 'lcm', '1', 'sel_lang', Context::getLangType(), 'return_uri', Context::get('current_url'));
         printf('<a href="%s">%s</a><br>%s', $url, 'Language : ' . Context::getLang('select_lang'), "\n");
     } else {
         printf('<a href="%s">%s</a><br>%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n");
     }
     if ($this->upperUrl) {
         $url = $this->upperUrl;
         printf('<btn href="%s" name="%s">%s', $url->url, $url->text, "\n");
     }
     if ($this->homeUrl) {
         $url = $this->homeUrl;
         printf('<a btn="%s" href="%s">%s</a><br>%s', $url->text, $url->url, $url->text, "\n");
     }
 }
开发者ID:perzona420,项目名称:xe-core,代码行数:29,代码来源:mhtml.class.php


示例7: getArticleUrl

/**
 * 文章地址
 */
function getArticleUrl($art_id)
{
    if ($art_id <= 0) {
        return '#';
    }
    return getUrl('article/index', array('article_id' => $art_id));
}
开发者ID:noikiy,项目名称:yg,代码行数:10,代码来源:function.php


示例8: __construct

 public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = FALSE)
 {
     $paymentData = explode('|', $config);
     /*ShopID|Separator|SecretKey|PaymentUrl */
     $this->shopID = $paymentData[0];
     $this->separator = $paymentData[1];
     $this->SecretKey = $paymentData[2];
     $this->paymentUrl = $paymentData[3];
     $this->numord = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId);
     $this->importo = number_format($order->DepositAmount * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY, 2, ',', '');
     $this->importoForMac = intval($order->DepositAmount * 100 * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY);
     if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) {
         $this->numord .= $this->separator . "R" . $suffixOrder;
         $this->importo = number_format($overrideAmount * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY, 2, ',', '');
         $this->importoForMac = intval($overrideAmount * 100 * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY);
     }
     $this->email = BFCHelper::getItem($order->CustomerData, 'email') . "";
     $this->languageId = $this->getLanguage($language);
     $this->url = $url;
     $this->urlBack = $urlBack;
     if ($debug) {
         $this->shopID = 'MYSHOP';
         $this->numord = 78;
         $this->importo = '17,00';
         $this->importoForMac = '1700';
         $this->SecretKey = '3DfEO2B5Jjm4VC1Q3vEh';
     }
     //$this->mac = $this->getMac();
     $this->redirectUrl = getUrl();
 }
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:30,代码来源:wspayform.php


示例9: _setParentUrl

 function _setParentUrl($menu_list)
 {
     if (!count($menu_list)) {
         return;
     }
     foreach ($menu_list as $key => $val) {
         if (!$val['text']) {
             continue;
         }
         if ($val['list'] && $this->_setParentUrl($val['list'])) {
             $href = $val['href'];
             if (preg_match('/^[a-z0-9_]+$/i', $val['url'])) {
                 $href = getUrl('', 'mid', $val['url'], 'smartphone', 'true');
             } else {
                 $href = $val['href'];
             }
             $this->setParentUrl($href);
             return false;
         }
         if ($val['url'] == Context::get('mid')) {
             return true;
         }
     }
     return false;
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:25,代码来源:smartphone.class.php


示例10: prepareItems

function prepareItems(&$items)
{
    foreach ($items as &$item) {
        $url = getUrl($item);
        $item = array('id' => crc32('auto_' . $url), 'target' => getTarget($item['subdomain']), 'url' => $url, 'maker' => isset($item['maker']) ? $item['maker'] : '', 'model' => isset($item['model']) ? $item['model'] : '', 'year' => isset($item['year']) ? $item['year'] : '', 'fuel' => isset($item['fuel']) ? $item['fuel'] : '', 'color' => isset($item['color']) ? $item['color'] : '', 'type' => isset($item['type']) ? $item['type'] : '', 'min_price' => isset($item['min_price']) ? $item['min_price'] : '', 'body_type' => isset($item['body_type']) ? $item['body_type'] : '', 'city_name' => isset($item['city_name']) ? $item['city_name'] : '', 'total' => isset($item['total']) ? $item['total'] : '', 'calc' => isset($item['calc']) ? $item['calc'] : '');
    }
}
开发者ID:sergrin,项目名称:crawlers-il,代码行数:7,代码来源:context_rk_auto.php


示例11: main_select

function main_select()
{
    global $Page;
    if ($Page != 'main') {
        echo "<a href=\"" . getUrl('Page', 'main') . "\">Messages</a>\n";
    }
}
开发者ID:teammember8,项目名称:roundcube,代码行数:7,代码来源:plugin.php


示例12: printBtn

 /**
  * @brief Button to output
  */
 function printBtn()
 {
     if ($this->nextUrl) {
         $url = $this->nextUrl;
         printf('<do type="vnd.next" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
     }
     if ($this->prevUrl) {
         $url = $this->prevUrl;
         printf('<do type="vnd.prev" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
     }
     // Others are not applicable in charge of the button output (array passed) type??
     if ($this->etcBtn) {
         if (is_array($this->etcBtn)) {
             foreach ($this->etcBtn as $key => $val) {
                 printf('<do type="vnd.btn%s" label="%s"><go href="%s"/></do>%s', $key, $val['text'], $val['url'], "\n");
             }
         }
     }
     // Select Language
     if (!parent::isLangChange()) {
         $url = getUrl('', 'lcm', '1', 'sel_lang', Context::getLangType(), 'return_uri', Context::get('current_url'));
         printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', 'Language : ' . lang('select_lang'), $url, "\n");
     } else {
         printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', lang('lang_return'), Context::get('return_uri'), "\n");
     }
     if ($this->homeUrl) {
         $url = $this->homeUrl;
         printf('<do type="access" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
     }
     if ($this->upperUrl) {
         $url = $this->upperUrl;
         printf('<do type="vnd.up" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
     }
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:37,代码来源:wml.class.php


示例13: getImage

function getImage($url)
{
    $newUrl = '';
    $imgContent = '';
    $ext = '(jpg|jpeg|gif|png)';
    $error_code = 0;
    if (substr($url, 0, 10) === 'data:image') {
        //base64编码的图片,可能出现在firefox粘贴,或者某些网站上,例如google图片等
        if (preg_match('/^data:image\\/' . $ext . '/i', $url, $match)) {
            $imgContent = base64_decode(substr($url, strpos($url, 'base64,') + 7));
        }
    } elseif (substr($url, 0, 5) === 'http:') {
        //url图片
        if (preg_match('/\\.' . $ext . '$/i', $url, $match)) {
            $imgContent = getUrl($url);
        }
    } else {
        // 上传的临时文件图片
        if (preg_match('/\\.' . $ext . '$/i', $url, $match)) {
            $imgContent = file_get_contents($url);
            unlink($url);
        }
    }
    $imageSize = strlen($imgContent);
    //文件体积不能小于1024,同时不能大于最大限制,默认5M
    if ($imageSize > 1024 && $imageSize <= 2.0E+20 * 5) {
        $newUrl = getNewUrl($match[1]);
        $newUrl = file_put_contents($newUrl, $imgContent) ? $newUrl : '';
    }
    $result = $newUrl ? array('success' => 1, 'url' => str_replace(JQE_ROOT, '', $newUrl), 'size' => $imageSize) : array('error' => $error_code, 'size' => $imageSize);
    return $result;
}
开发者ID:meiwenhui,项目名称:jqeditor,代码行数:32,代码来源:common.php


示例14: urlParamsResolver

 /**
  * methodName
  *
  * @param string $url
  * @param array $paramToAdd
  * @param array $paramToRemove
  * @return string
  */
 private static function urlParamsResolver($url, $paramToAdd = [])
 {
     $getArray = $_GET;
     $currentUrl = getUrl();
     $queryString = http_build_query(array_merge(is_array($getArray) ? $getArray : [$getArray], $paramToAdd));
     return $currentUrl . ($queryString ? '?' . $queryString : '');
 }
开发者ID:bonaccorsop,项目名称:JambonOrders,代码行数:15,代码来源:AppSerializer.php


示例15: inscritos

function inscritos()
{
    if (validarAdministradorPrivado()) {
        if (isset($_GET['i']) && is_numeric($_GET['i'])) {
            $idGrupo = $_GET['i'];
            require_once 'modulos/grupos/modelos/grupoModelo.php';
            $offset = 0;
            $numRows = 16;
            $pagina = 1;
            if (isset($_GET['p'])) {
                if (is_numeric($_GET['p'])) {
                    $pagina = intval($_GET['p']);
                    $offset = $numRows * ($pagina - 1);
                }
            }
            $res = getUsuariosDelGrupo($idGrupo, $offset, $numRows);
            $usuarios = $res['usuarios'];
            $numUsuarios = $res['n'];
            $maxPagina = ceil($numUsuarios / $numRows);
            if ($pagina != 1 && $pagina > $maxPagina) {
                redirect("grupos/usuarios/inscritos/1&p=" . $maxPagina);
            } else {
                pushBreadCrumb(getUrl(), "Lista de usuarios del grupo", true, 1);
                require_once 'modulos/grupos/vistas/usuariosDelGrupo.php';
            }
        } else {
            setSessionMessage("Grupo no válido", " ¡Error! ", "error");
            redirect("/grupos");
        }
    } else {
        goToIndex();
    }
}
开发者ID:netor27,项目名称:UnovaPrivado,代码行数:33,代码来源:usuariosControlador.php


示例16: printUserBox

function printUserBox()
{
    global $userData;
    global $isLoggedIn;
    global $authUrl;
    handleNameChange();
    echo "<div class='userBox box header'>";
    if ($isLoggedIn) {
        echo "<img class='circle-image' src='" . $userData['picture'] . "' width=100px height=100px /><br/>";
        if (!isset($_GET["settings"])) {
            echo "<p class='welcome'>Welcome <a href='" . $userData['link'] . "'>" . getUsername($userData) . "</a></p>";
        } else {
            echo "<form action='" . getUrl() . "' method='post'>";
            echo "<p class='welcome'>Welcome";
            echo "<input type='text' name='displayName' value='" . getUsername($userData) . "'/>";
            echo "<input type='submit' value='Submit'>";
            echo "</p></form>";
        }
        echo "<div class='userBoxBottom'>";
        echo "<div class='settings'><a href='?settings'><img src='Settings.png' width=16px height=16px /></a></div>";
        echo "<div class='logout'><a href='?logout'>Logout</a></div></div>";
    } else {
        echo "<a href='{$authUrl}'>Sign in using Google</a>";
    }
    echo "</div>";
}
开发者ID:Werner1201,项目名称:The-FoxPotato-Project,代码行数:26,代码来源:user.php


示例17: postToSlack

function postToSlack($text, $attachments_text = '')
{
    $slackUrl = 'https://slack.com/api/chat.postMessage?token=' . SLACK_TOKEN . '&channel=' . urlencode(SLACK_CHANNEL) . '&username=' . urlencode(SLACK_BOT_NAME) . '&icon_url=' . SLACK_BOT_AVATAR . '&unfurl_links=1&parse=full&pretty=1' . '&text=' . urlencode($text);
    if ($attachments_text) {
        $slackUrl .= '&attachments=' . urlencode('[{"text": "' . $attachments_text . '"}]');
    }
    var_dump(getUrl($slackUrl));
}
开发者ID:mattharbo,项目名称:worldcup-slack-bot,代码行数:8,代码来源:worldCupNotifier.php


示例18: getModuleFeedUrl

 /**
  * Create the Feed url.
  *
  * @param string $vid Vid
  * @param string $mid mid
  * @param string $format Feed format. rss | atom
  * @param bool $absolute_url
  * @return string
  */
 function getModuleFeedUrl($vid, $mid, $format = 'rss', $absolute_url = false)
 {
     if ($absolute_url) {
         return getFullUrl('', 'vid', $vid, 'mid', $mid, 'act', $format);
     } else {
         return getUrl('', 'vid', $vid, 'mid', $mid, 'act', $format);
     }
 }
开发者ID:kimkucheol,项目名称:xe-core,代码行数:17,代码来源:rss.model.php


示例19: getDirUrl

function getDirUrl()
{
    $url = getUrl();
    $path = explode('?', $url, 2)[0];
    $dirpath_end = strrpos($path, '/');
    $dirpath = substr($path, 0, $dirpath_end);
    return $dirpath;
}
开发者ID:Fiware,项目名称:webui.POIDataProvider,代码行数:8,代码来源:add_user.php


示例20: getThisUrlFileParam

function getThisUrlFileParam()
{
    $url = '';
    $url = getUrl();
    $url = mid($url, inStrRev($url, '/') + 1, -1);
    $getThisUrlFileParam = $url;
    return @$getThisUrlFileParam;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:8,代码来源:URL.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getUrlData函数代码示例发布时间:2022-05-15
下一篇:
PHP getUrAlbum函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap