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


PHP UrlHelper::current方法代码示例

本文整理汇总了PHP中UrlHelper::current方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlHelper::current方法的具体用法?PHP UrlHelper::current怎么用?PHP UrlHelper::current使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UrlHelper的用法示例。


在下文中一共展示了UrlHelper::current方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCurrent

 /**
  * Returns a function creating a URL by using the current route and the GET parameters.
  * @return \Closure A function creating a URL by using the current route and the GET parameters.
  */
 public function getCurrent() : \Closure
 {
     return function ($value, \Mustache_LambdaHelper $helper) {
         $args = $this->parseArguments($helper->render($value), 'params', ['scheme' => false]);
         return UrlHelper::current($args['params'], $args['scheme']);
     };
 }
开发者ID:cedx,项目名称:yii2-mustache,代码行数:11,代码来源:URL.php

示例2: admin_setup

 function admin_setup()
 {
     if ($this->layout) {
         $this->layout = $this->load->layout('admin');
     }
     $default_utility = '/' . DEFAULT_MODULE . '/admin/' . DEFAULT_MODULE . 'admin';
     if (!file_exists(APPD_APPLICATION . '/' . DEFAULT_MODULE . '/admin/' . DEFAULT_MODULE . 'admin.utility.php')) {
         $default_utility = '/admin/admin/adminadmin';
     }
     $util = $this->load->utility($default_utility);
     $path = $util ? DEFAULT_MODULE . '/' . DEFAULT_MODULE : 'admin/index';
     $default_config = array('roles' => array('admin' => array('home' => $path, 'modules' => '*')), 'time_limit' => 500, 'memory_limit' => '128M');
     $this->config = array_merge($default_config, $this->config);
     $roles = array_keys($this->config['roles']);
     $this->plugin->Auth->addArea('admin-area', $roles);
     foreach ($roles as $role) {
         $this->plugin->Auth->addRole($role, array('member-area', 'admin-area', 'open-area'));
     }
     $this->plugin->Auth->authorize('admin-area', array('admin', 'node', 'node_process', 'error'), array(&$this, '_goLogin'));
     if (isset($this->config['language']) && $this->config['language'] != Lang::getCurrent()) {
         $this->helper->redirect->to(UrlHelper::current($this->config['language']));
     }
     if (!ini_get('safe_mode') && is_callable('set_time_limit') && is_callable('ini_set')) {
         @set_time_limit($this->config['time_limit']);
         @ini_set("memory_limit", $this->config['memory_limit']);
     }
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:27,代码来源:admin.controller.php

示例3: loginRedirect

 private function loginRedirect()
 {
     if ($this->requested_module != $this->config['module_name']) {
         RedirectHelper::flash($this->config['module_name'] . '/' . $this->config['login_action'], 'next', UrlHelper::current('', false));
     } else {
         RedirectHelper::to('/');
     }
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:8,代码来源:auth.plugin.php

示例4: hashLink

 static function hashLink($text, $href, $attributes = array(), $escape = true)
 {
     if ($href && $href[0] != '#') {
         $href = '#' . $href;
     }
     $href = UrlHelper::current() . $href;
     return self::absoluteLink($text, $href, $attributes, $escape);
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:8,代码来源:html.helper.php

示例5: stripslashes

        $value = stripslashes($value);
    }
    $gpc = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    array_walk_recursive($gpc, 'undo_magic_quotes');
}
$plugin_manager = PluginManager::getInstance();
$url_mapper = new UrlMapper();
$context = $url_mapper->map($_SERVER['REQUEST_URI']);
if (!$context) {
    header("HTTP/1.1 400 Bad Request");
    @(include PHAXSI_ERROR_400);
    exit;
}
if (AppConfig::$language_redirect && !Lang::wasSet()) {
    $lang = Lang::autoDetect();
    RedirectHelper::to(UrlHelper::current($lang));
}
if (AppConfig::CUSTOM_ROUTER) {
    $router_name = Loader::includeApplicationClass(new Context('router', AppConfig::CUSTOM_ROUTER));
    if ($router_name) {
        $router = new $router_name();
    } else {
        trigger_error('Custom router "' . AppConfig::CUSTOM_ROUTER . '" was not found', E_USER_ERROR);
    }
} else {
    $router = new Router();
}
$controller = $router->getController($context);
if (!$controller) {
    header("HTTP/1.1 404 Not Found");
    @(include PHAXSI_ERROR_404);
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:31,代码来源:main.php


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