當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。