本文整理汇总了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);
}
示例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();
}
示例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;
}
示例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;
}
示例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();
?>
示例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
示例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;
示例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">
示例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;
}
}
示例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')));
}
示例11: redirectToSelf
public static function redirectToSelf()
{
header('Location: ' . Url::getCurrentUrl());
exit;
}
示例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() . '&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;
?>
示例13: isLocalUrl
public function isLocalUrl()
{
$local = Url::getCurrentUrl();
return $this->get(URL_SERVER) === $local->get(URL_SERVER);
}
示例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);
示例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>