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


PHP Tool::url_merge方法代碼示例

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


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

示例1: _get_url

 /**
  * 為指定的頁麵返回地址值
  * @param int $pageno
  * @return string $url
  */
 function _get_url($pageno = 1)
 {
     if (empty($this->page_tpl)) {
         return Tool::url_merge('page', $pageno, 'mvc,q');
     } else {
         return str_replace('{page}', $pageno, $this->page_tpl);
     }
 }
開發者ID:kilmas,項目名稱:framework,代碼行數:13,代碼來源:Pager.php

示例2: _get_url

 /**
  * 為指定的頁麵返回地址值
  *
  * @param int $pageno
  * @return string $url
  */
 function _get_url($pageno = 1)
 {
     if (empty($this->page_tpl)) {
         return Tool::url_merge('page', $pageno, 'mvc,q');
     } else {
         return sprintf($this->page_tpl, $pageno);
     }
 }
開發者ID:jasonshaw,項目名稱:framework-1,代碼行數:14,代碼來源:Pager.php

示例3: showTrace

    /**
     * 顯示跟蹤信息
     * @return string
     */
    public function showTrace()
    {
        $_trace = array();
        $included_files = get_included_files();
        // 係統默認顯示信息
        if (!empty($this->request->server['SCRIPT_NAME'])) {
            $_trace['請求腳本'] = $this->request->server['SCRIPT_NAME'];
        }
        $_trace['請求方法'] = $this->swoole->env['mvc']['controller'] . '/' . $this->swoole->env['mvc']['view'];
        $_trace['USER_AGENT'] = $this->request->server['HTTP_USER_AGENT'];
        $_trace['HTTP版本'] = $this->request->server['SERVER_PROTOCOL'];
        $_trace['請求時間'] = date('Y-m-d H:i:s', $this->request->server['REQUEST_TIME']);
        if (isset($_SESSION)) {
            $_trace['SESSION_ID'] = session_id();
        }
        if ($this->swoole->db instanceof \Swoole\Database) {
            $_trace['讀取數據庫'] = $this->swoole->db->read_times . '次';
            $_trace['寫入數據庫'] = $this->swoole->db->write_times . '次';
        }
        $_trace['加載文件數目'] = count($included_files);
        $_trace['PHP執行占用'] = $this->showTime();
        $_trace = array_merge($this->traceInfo, $_trace);
        // 調用Trace頁麵模板
        $html = <<<HTMLS
<style type="text/css">
#swoole_trace_content  {
font-family:\t\tConsolas, Courier New, Courier, monospace;
font-size:\t\t\t14px;
background-color:\t#fff;
margin:\t\t\t\t40px;
color:\t\t\t\t#000;
border:\t\t\t\t#999 1px solid;
padding:\t\t\t20px 20px 12px 20px;
}
</style>
\t<div>
\t\t<fieldset style="margin:5px;">
\t\t<div style="overflow:auto;text-align:left;">
HTMLS;
        $html .= "<a href='" . Tool::url_merge('_show_request', '1') . "'>顯示請求參數</a> |\n        <a href='" . Tool::url_merge('_show_session', '1') . "'>顯示會話信息</a> |\n        <a href='" . Tool::url_merge('_show_files', '1') . "'>顯示加載的PHP文件</a>\n        <hr/>";
        foreach ($_trace as $key => $info) {
            $html .= $key . ' : ' . $info . BL;
        }
        if (!empty($this->request->get['_show_files'])) {
            //輸出包含的文件
            $html .= '加載的文件:' . BL . "<pre style='color: #666'>";
            foreach ($included_files as $file) {
                $html .= $file . "\n";
            }
            $html .= "</pre>";
        }
        $html .= "</div></fieldset>";
        $html .= "</div>";
        if (!empty($this->request->get['_show_request'])) {
            $output = '<fieldset style="margin:5px;"><div style="overflow:auto;text-align:left;">';
            $request = $this->swoole->request;
            $output .= "<h2>HEADER:</h2>" . Tool::dump($request->header);
            $output .= "<h2>SERVER:</h2>" . Tool::dump($request->server);
            if (!empty($request->files)) {
                $output .= "<h2>FILE:</h2>" . Tool::dump($request->files);
            }
            if (!empty($request->cookie)) {
                $output .= "<h2>COOKIES:</h2>" . Tool::dump($request->cookie);
            }
            if (!empty($request->get)) {
                $output .= "<h2>GET:</h2>" . Tool::dump($this->swoole->request->get);
            }
            if (!empty($request->post)) {
                $output .= "<h2>POST:</h2>" . Tool::dump($request->post);
            }
            $html .= $output . "</div></fieldset>";
        }
        if (!empty($this->request->get['_show_session'])) {
            $output = '<fieldset style="margin:5px;"><div style="overflow:auto;text-align:left;">';
            $this->session->start();
            $output .= "<h2>SESSION:</h2>" . Tool::dump($request->session);
            $html .= $output . "</div></fieldset>";
        }
        return $html;
    }
開發者ID:matyhtf,項目名稱:swoole_framework,代碼行數:84,代碼來源:Controller.php


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