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


PHP io::route方法代码示例

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


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

示例1: routing

 public function routing()
 {
     /*
      * You can echo HTML and other information directly from models or controllers
      * however it is usually better to create views for displaying model data.
      */
     // Session tracking
     io::library('session');
     // HTML Header
     echo '<h2>Routing Information</h2>';
     // Explain a little bit
     echo '<p>This method may be useful during development or even within your application. It provides easy access to important information related to routing, like which controller and action were routed. It also conveniently provides access to $_GET, $_POST, $_SESSION, $_COOKIE and parameters passed to Ornithopter during normal routing... </p>';
     echo '<blockquote>Accessible by calling <strong class="io">io::route()</strong> within Ornithopter.io</blockquote>';
     // Access the internals of Ornithopter.io easily
     var_dump(io::route());
 }
开发者ID:olscore,项目名称:ornithopter.io,代码行数:16,代码来源:demo.php

示例2: nav

 /**
  * Returns a string if controller / action is matched.
  *
  * @return mixed
  */
 public static function nav($path, $str)
 {
     // Check if the path is an alternative route
     if (\io::route()['controller'] == $path) {
         // Return the provided string
         return $str;
     }
     // Check if the path equals the controller action
     if ($path == \io::route()['controller'] . '/' . \io::route()['action']) {
         // Return the provided string
         return $str;
     }
     // Check if the path is equal to the REQUEST_URI
     if ($_SERVER['REQUEST_URI'] == $path) {
         // Return the provided string
         return $str;
     }
     // Does not match
     return false;
 }
开发者ID:olscore,项目名称:ornithopter.io,代码行数:25,代码来源:page.php

示例3: has

 /**
  * Checks if a $_GET variable exists.
  *
  * @param string
  *
  * @return bool
  */
 public static function has($var)
 {
     // Return $var existance as boolean
     return isset(io::route()['get'][$var]);
 }
开发者ID:olscore,项目名称:ornithopter.io,代码行数:12,代码来源:ornithopter.php

示例4: querystring

 /**
  * Get the query string.
  *
  * @return string
  */
 public static function querystring()
 {
     // Return the Query String
     return \io::route()['query'];
 }
开发者ID:olscore,项目名称:ornithopter.io,代码行数:10,代码来源:web.php


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