当前位置: 首页>>代码示例>>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;未经允许,请勿转载。