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


PHP getUrl函数代码示例

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


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


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