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


PHP Url::getCurrentUrl方法代碼示例

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


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

示例1: login

 protected function login()
 {
     if (Router::$IS_AJAX || Router::$IS_IFRAME) {
         $this->renderError('請先登錄!');
     }
     $backUrl = Url::getCurrentUrl(array('back-url' => null));
     $url = Url::make('//uc.hqoj.net/login/', array('back-url' => $backUrl));
     Url::redirect($url);
 }
開發者ID:aozhongxu,項目名稱:web_hqoj,代碼行數:9,代碼來源:BaseController.class.php

示例2: __construct

 public function __construct($rows, $max = 10)
 {
     $this->_records = $rows;
     $this->_numb_of_records = count($this->_records);
     $this->_max_pp = $max;
     $this->_url = Url::getCurrentUrl(self::$_key);
     $current = Url::getParam(self::$_key);
     $this->_current = !empty($current) ? $current : 1;
     $this->numberOfPages();
     $this->getOffset();
 }
開發者ID:sydorenkovd,項目名稱:e-com.loc,代碼行數:11,代碼來源:Paging.php

示例3: check

 /**
  * 驗證權限
  * @param  uid 用戶權限id
  * @param model 模式 1=>url模式,2=>權限id模式,3=>權限名稱模式
  * @author Colin <15070091894@163.com>
  */
 public function check($uid = null, $model = 1)
 {
     $auths = $this->getUserAuths($uid);
     $current = Url::getCurrentUrl();
     list($controller, $method) = $current;
     foreach ($auths as $key => $value) {
         $url = explode('/', $value['url']);
         list($auth_controller, $auth_method) = $url;
         //是否驗證其他
         if ($this->auth_other === false) {
             $auth = D('Auth');
             if (!($find = $auth->where('url', implode('/', $current))->find())) {
                 return true;
             }
         }
         if ($auth_controller == $controller && $auth_method == $method) {
             return true;
         }
     }
     return false;
 }
開發者ID:a1586256143,項目名稱:MyClassPHP,代碼行數:27,代碼來源:Auth.class.php

示例4: insert

 private static function insert($tag, $level, $msg)
 {
     // 是否需要Logger
     if (!GlobalConfig::$LOGGER_ENABLE) {
         return;
     }
     // 臨時關閉Logger
     $tmpEnable = GlobalConfig::$LOGGER_ENABLE;
     GlobalConfig::$LOGGER_ENABLE = false;
     // 校驗tag
     $tags = LoggerKeys::$allTags;
     if (!in_array($tag, $tags)) {
         throw new LibraryException("TAG:{$tag} 需要在LoggerKeys中定義!");
     }
     // 獲取錯誤信息
     if (is_subclass_of($msg, 'Exception')) {
         $traceList = $msg->getTrace();
         $message = $msg->getMessage();
         $traceInfo = $traceList[0];
         $loc = $traceInfo['file'] . ':' . $traceInfo['line'];
     } else {
         $traceList = debug_backtrace();
         $message = $msg;
         $traceInfo = $traceList[1];
         $loc = $traceInfo['file'] . ':' . $traceInfo['line'];
     }
     $now = time();
     $data = array('create_time' => $now, 'update_time' => $now, 'tag' => $tag, 'level' => $level, 'client_ip' => Http::getClientIp(), 'client_port' => Http::getClientPort(), 'server_ip' => Http::getServerIp(), 'server_port' => Http::getServerPort(), 'url' => Url::getCurrentUrl(), 'post' => json_encode($_POST), 'loc' => $loc, 'message' => $message, 'trace' => json_encode($traceList));
     if (GlobalConfig::$LOGGER_ASYNC) {
         $gearman = GearmanPool::getClient(GearmanConfig::$SERVER_COMMON);
         $gearman->doBackground('logger_async', json_encode($data));
     } else {
         LoggerInterface::save($data);
     }
     GlobalConfig::$LOGGER_ENABLE = $tmpEnable;
 }
開發者ID:aozhongxu,項目名稱:web_hqoj,代碼行數:36,代碼來源:Logger.class.php

示例5: Url

    echo '<div id="test">';
    $url = Url::getCurrentUrl();
    $url->setQueryVar('noTest');
    echo '<a href="' . $url . '">Deactivate testing mode</a>';
    echo '</div>';
} else {
    // do not display testing stuff
}
?>
		<header>
			<h1>Charte Éditeurs-Fansubs</h1>
			<h2>Tentative d'accord à l'amiable entre des acteurs voulant promouvoir la Japanimation en France</h2>
		</header>
		<nav>
			<?php 
$url = Url::getCurrentUrl();
$displayedPage = Page::getDisplayedPage();
foreach (Page::getAvailablePages() as $page) {
    $url = new Url();
    $url->setQueryVar('page', $page->getId());
    echo '<a ' . ($displayedPage == $page ? 'class="selected"' : '') . ' href="' . $url . '">' . $page->getMenuTitle() . '</a>';
}
echo Format::toHtmlEmail('sazaju@gmail.com', "Contact");
?>
		</nav>
		<article>
			<?php 
$page = Page::getDisplayedPage();
echo '<div id="lastUpdateTime">Last update: ' . date("d/m/Y H:i:s", $page->getLastUpdateTime()) . '</div>';
echo $page->getContent();
?>
開發者ID:KasaiDot,項目名稱:Charte-Fansubs-Editeurs,代碼行數:31,代碼來源:index.php

示例6: Business

$objBusiness = new Business();
$business = $objBusiness->getBusiness();
if (!empty($business)) {
    $objForm = new Form();
    $objValid = new Validation($objForm);
    if ($objForm->isPost('name')) {
        $objValid->_expected = array('name', 'address', 'telephone', 'email', 'website', 'vat_rate');
        $objValid->_required = array('name', 'address', 'telephone', 'email', 'vat_rate');
        $objValid->_special = array('email' => 'email');
        $vars = $objForm->getPostArray($objValid->_expected);
        if ($objValid->isValid()) {
            if ($objBusiness->updateBusiness($vars)) {
                Helper::redirect('/admin' . Url::getCurrentUrl(array('action', 'id')) . '&action=edited');
            } else {
                Helper::redirect('/admin' . Url::getCurrentUrl(array('action', 'id')) . '&action=edited-failed');
            }
        }
    }
    require_once 'template/_header.php';
    ?>
	
	<h1>Business</h1>
	
	<form action="" method="post">
		<table cellpadding="0" cellspacing="0" border="0" class="tbl_insert">
			
			<tr>
				<th><label for="name">Name: *</label></th>
				<td>
					<?php 
開發者ID:sydorenkovd,項目名稱:e-com.loc,代碼行數:30,代碼來源:edit.php

示例7: sprintf

echo $firstPage;
?>
" href="<?php 
echo $firstUrl;
?>
">首頁</a></li><li><a class="item item-lg" name="pager" value="<?php 
echo $prePage;
?>
" href="<?php 
echo $preUrl;
?>
">上一頁</a></li><?php 
if ($lastPage) {
    for ($i = $beginPage; $i < $beginPage + $length; $i++) {
        $isSelected = $currentPage == $i ? 'selected' : '';
        $url = $currentPage == $i ? '#' : Url::getCurrentUrl(array('page' => $i));
        echo sprintf('<li><a class="item %s" name="pager" value="%s" href="%s">%s</a></li>', $isSelected, $i, $url, $i);
    }
}
?>
<li><a class="item item-lg" name="pager" value="<?php 
echo $nextPage;
?>
" href="<?php 
echo $nextUrl;
?>
">下一頁</a></li><li><a class="item item-lg" name="pager" value="<?php 
echo $lastPage;
?>
" href="<?php 
echo $lastUrl;
開發者ID:aozhongxu,項目名稱:web_hqoj,代碼行數:31,代碼來源:pager_white.php

示例8: array

                            <a href="/setup_uc_update/">會員中心</a> |
                            <a href="<?php 
    echo Url::make('//uc.hqoj.net/logout/', array('back-url' => Url::getCurrentUrl(array('back-url' => null))));
    ?>
">退出</a>
                        </div>
                    <?php 
} else {
    ?>
                        <div>
                            <a href="<?php 
    echo Url::make('//uc.hqoj.net/login/', array('back-url' => Url::getCurrentUrl(array('back-url' => null))));
    ?>
">登錄</a> |
                            <a href="<?php 
    echo Url::make('//uc.hqoj.net/register/', array('back-url' => Url::getCurrentUrl(array('back-url' => null))));
    ?>
">注冊</a>
                        </div>
                    <?php 
}
?>

                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="module-wrap">
開發者ID:aozhongxu,項目名稱:web_hqoj,代碼行數:31,代碼來源:framework.php

示例9: buildRssUrlIfAvailable

function buildRssUrlIfAvailable()
{
    if (getCurrentPage() == 'news') {
        $url = Url::getCurrentUrl();
        new NewsSelector();
        //force class loading for constants
        $selected = $url->hasQueryVar('select') ? $url->getQueryVar('select') : NEWSSELECTOR_ALL;
        $rssUrl = new Url('rss.php');
        $rssUrl->setQueryVar('select', empty($selected) ? null : $selected, true);
        $rssUrl->setQueryVar('h', null, !$_SESSION[MODE_H]);
        return $rssUrl;
    } else {
        return null;
    }
}
開發者ID:KasaiDot,項目名稱:Zero-Fansub-website,代碼行數:15,代碼來源:index.php

示例10: SimpleBlockComponent

<?php

$page = PageContent::getInstance();
$page->setClass('project');
$project = Project::getProject(Url::getCurrentUrl()->getQueryVar('id'));
if ($project->isHentai() && !$_SESSION[MODE_H]) {
    require_once "pages/havert.php";
} else {
    if (TEST_MODE_ACTIVATED) {
        $options = new SimpleBlockComponent();
        $options->setClass('testFeatures');
        $options->addComponent("Options : ");
        $link = new Link(Url::getCurrentUrl(), "show hidden");
        if ($link->getUrl()->hasQueryVar('showHidden')) {
            $link->getUrl()->removeQueryVar('showHidden');
            $link->setClass('reverse');
        } else {
            $link->getUrl()->setQueryVar('showHidden');
        }
        $options->addComponent($link);
        $page->addComponent($options);
    }
    $page->addComponent(new Title($project->getName(), 1));
    $page->addComponent(new ProjectComponent($project, Url::getCurrentUrl()->hasQueryVar('showHidden')));
}
開發者ID:KasaiDot,項目名稱:Zero-Fansub-website,代碼行數:25,代碼來源:project.php

示例11: redirectToSelf

 public static function redirectToSelf()
 {
     header('Location: ' . Url::getCurrentUrl());
     exit;
 }
開發者ID:o-log,項目名稱:php-lib,代碼行數:5,代碼來源:Redirects.php

示例12: User

<?php

$id = Url::getParam('id');
if (!empty($id)) {
    $objUser = new User();
    $user = $objUser->getUser($id);
    if (!empty($user)) {
        $objOrder = new Order();
        $orders = $objOrder->getClientOrders($id);
        if (empty($orders)) {
            $yes = '/admin' . Url::getCurrentUrl() . '&amp;remove=1';
            $no = 'javascript:history.go(-1)';
            $remove = Url::getParam('remove');
            if (!empty($remove)) {
                $objUser->removeUser($id);
                Helper::redirect('/admin' . Url::getCurrentUrl(array('action', 'id', 'remove', 'srch', Paging::$_key)));
            }
            require_once 'template/_header.php';
            ?>
<h1>Clients :: Remove</h1>
<p>Are you sure you want to remove this client (<?php 
            echo $user['first_name'] . " " . $user['last_name'];
            ?>
)?<br />
There is no undo!<br />
<a href="<?php 
            echo $yes;
            ?>
">Yes</a> | <a href="<?php 
            echo $no;
            ?>
開發者ID:sydorenkovd,項目名稱:e-com.loc,代碼行數:31,代碼來源:remove.php

示例13: isLocalUrl

 public function isLocalUrl()
 {
     $local = Url::getCurrentUrl();
     return $this->get(URL_SERVER) === $local->get(URL_SERVER);
 }
開發者ID:KasaiDot,項目名稱:Zero-Fansub-website,代碼行數:5,代碼來源:url.php

示例14: function

};
$intendedFilter = function (Project $project) {
    return !$project->isHidden() && $project->isIntended();
};
if (TEST_MODE_ACTIVATED) {
    $options = new SimpleBlockComponent();
    $options->setClass('testFeatures');
    $options->addComponent("Options : ");
    $link = new Link(Url::getCurrentUrl(), "show hidden");
    if ($link->getUrl()->hasQueryVar('showHidden')) {
        $link->getUrl()->removeQueryVar('showHidden');
        $link->setClass('reverse');
    } else {
        $link->getUrl()->setQueryVar('showHidden');
    }
    $options->addComponent($link);
    $page->addComponent($options);
}
// TODO limit to authorized access
if (Url::getCurrentUrl()->hasQueryVar('showHidden')) {
    call_user_func($listProcessor, new Title("Projets cachés", 2), $allProjects, $hiddenFilter, $useImageLists);
}
$categoryMap = array("subs" => $notLicensedAnimes, "scans" => $notLicensedDoujin);
$filterMap = array("en cours" => $runningFilter, "terminés" => $finishedFilter, "abandonnés" => $abandonnedFilter, "envisagés" => $intendedFilter);
$page->addComponent(new Title("Légalement indisponibles", 2));
foreach ($categoryMap as $category => $projects) {
    foreach ($filterMap as $desc => $filter) {
        call_user_func($listProcessor, ucfirst($category) . " " . $desc, $projects, $filter, $useImageLists);
    }
}
call_user_func($listProcessor, new Title("Légalement disponibles", 2), $allProjects, $licensedFilter, $useImageLists);
開發者ID:KasaiDot,項目名稱:Zero-Fansub-website,代碼行數:31,代碼來源:projects.php

示例15: foreach

<link rel="stylesheet" href="//sta.hqoj.net/js/plugin/kindeditor/plugins/code/prettify.css" />
<link type="text/css" href="//sta.hqoj.net/css/www/oj/doc_list.page.css" rel="stylesheet">

<div class="sidebar">
    <div class="nav" id="sidebar-fixed" >
        <div class="menu">
            <ul>
                <?php 
foreach ($this->docList as $docInfo) {
    ?>
                    <li>
                        <a <?php 
    echo Request::getGET('doc-id') == $docInfo['id'] ? 'class="hover"' : '';
    ?>
 href="<?php 
    echo Url::make(Url::getCurrentUrl(), array('doc-id' => $docInfo['id']));
    ?>
">
                            <span class="text"><?php 
    echo $docInfo['title'];
    ?>
</span>
                        </a>
                    </li>
                <?php 
}
?>
            </ul>
        </div>
    </div>
</div>
開發者ID:aozhongxu,項目名稱:web_hqoj,代碼行數:31,代碼來源:list.php


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