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


PHP Routes::getInstance方法代码示例

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


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

示例1: render

 public static function render($path, array $args = array())
 {
     if (self::$_instance === NULL) {
         self::init();
     }
     $args['request'] = Request::getInstance();
     $args['static_url'] = Rivet::getInstance()->config['static_url'];
     $template = self::$_instance->twig->loadTemplate($path);
     $template->routes = Routes::getInstance();
     self::$_instance->body = $template->render($args);
     return self::$_instance->body;
 }
开发者ID:plasticine,项目名称:rivet,代码行数:12,代码来源:Template.php

示例2: dispatch

 public function dispatch()
 {
     if (self::$_instance === NULL) {
         self::getInstance();
     }
     $routes = Routes::getInstance();
     $route = $routes->match();
     if ($route) {
         $view = $route->run();
         if ($view instanceof Response) {
             self::$_instance->response = $view;
         }
         // allow returning a response straight from the view
         self::$_instance->response = new Response($view);
         return self::$_instance->response;
     }
     return notfound();
 }
开发者ID:plasticine,项目名称:rivet,代码行数:18,代码来源:Rivet.php

示例3: reverse

function reverse()
{
    $routes = Routes::getInstance();
    return $routes->reverse(func_get_args());
}
开发者ID:agar,项目名称:rivet,代码行数:5,代码来源:Routes.php

示例4: __construct

 public function __construct($route_name, $params, $lineno)
 {
     parent::__construct($lineno);
     $routes = Routes::getInstance();
     $this->url = $routes->reverse(array($route_name, $params));
 }
开发者ID:plasticine,项目名称:twig-rivet-url,代码行数:6,代码来源:twig-url.php

示例5: doRoute

 public static function doRoute()
 {
     $routesInstance = Routes::getInstance();
     $routeAction = $routesInstance->getAction();
     // make sure we dont show a 404
     global $wp_query;
     if ($wp_query->is_404) {
         $wp_query->is_404 = false;
         $wp_query->is_archive = true;
     }
     header("HTTP/1.0 200 OK");
     //header("Content-Type: text/html; charset=UTF-8");
     //var_dump($routeAction->action);
     //var_dump($routeAction);
     if ($routeAction->action['type'] == 'pagename') {
         query_posts(array('pagename' => $routeAction->action['name']));
     } else {
         if ($routeAction->action['type'] == 'filename') {
             include TEMPLATEPATH . '/' . $routeAction->action['name'];
             exit;
         }
     }
 }
开发者ID:foo123,项目名称:routes-for-wp,代码行数:23,代码来源:routes.php

示例6: evaluateRoute

 /**
  * Evaluate route by given URL
  */
 private function evaluateRoute()
 {
     Routes::getInstance()->loadRoutes()->evaluateURL();
 }
开发者ID:natanaelsimoes,项目名称:zeus-framework,代码行数:7,代码来源:Framework.php


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