aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2015-01-05 23:46:55 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2015-01-05 23:46:55 +0100
commita7d1bb64f786915c9843cea8115f340ee4161115 (patch)
tree2635df228fa53b406c5ce6e3307cb75b2418e38e
parent126b3dd522a1e9e7e63fed11acaf2ea678935b4e (diff)
parentaee139e28a1766a08dd4e41ae3d8ca1b710d6e13 (diff)
downloadRouter-a7d1bb64f786915c9843cea8115f340ee4161115.zip
Router-a7d1bb64f786915c9843cea8115f340ee4161115.tar.gz
Router-a7d1bb64f786915c9843cea8115f340ee4161115.tar.bz2
Merge branch '_method' into incoming
-rw-r--r--Documentation/Fr/Index.xyl16
-rw-r--r--Http.php2
2 files changed, 14 insertions, 4 deletions
diff --git a/Documentation/Fr/Index.xyl b/Documentation/Fr/Index.xyl
index 47fbe2f..dba735c 100644
--- a/Documentation/Fr/Index.xyl
+++ b/Documentation/Fr/Index.xyl
@@ -149,6 +149,8 @@ print_r($router->getTheRule());
* [5] =>
* [6] => Array
* (
+ * [_uri] => hello
+ * [_method] => get
* [_domain] =>
* [_subdomain] =>
* [_call] =>
@@ -215,10 +217,12 @@ print_r($theRule[$router::RULE_VARIABLES]);
* Will output:
* Array
* (
- * [_domain] =>
- * [_subdomain] =>
- * [_call] =>
- * [_able] =>
+ * [_uri] => hello_gordon
+ * [_method] => get
+ * [_domain] =>
+ * [_subdomain] =>
+ * [_call] =>
+ * [_able] =>
* [_request] => Array
* (
* )
@@ -373,6 +377,8 @@ var_dump($router->unroute('h', array('who' => 'alyx')));
<code>HEAD</code> et <code>OPTIONS</code>. Les <strong>variables</strong>
réservées pour la méthode <code>Hoa\Router\Http::route</code> sont :</p>
<ul>
+ <li><code>_uri</code>, l'<strong>adresse</strong> ;</li>
+ <li><code>_method</code>, la <strong>méthode</strong> HTTP ;</li>
<li><code>_domain</code>, le <strong>domaine</strong> (de la forme
<code>domain.tld</code>) ;</li>
<li><code>_subdomain</code>, le <strong>sous-domaine</strong> (que nous
@@ -504,6 +510,8 @@ print_r($router->getTheRule());
* [5] =>
* [6] => Array
* (
+ * [_uri] => gordon.domain.tld/Project/Space-biker.html
+ * [_method] => get
* [_domain] => gordon.domain.tld
* [_subdomain] => gordon
* [_call] =>
diff --git a/Http.php b/Http.php
index fb574f8..cde6f77 100644
--- a/Http.php
+++ b/Http.php
@@ -396,6 +396,8 @@ class Http extends Generic implements \Hoa\Core\Parameter\Parameterizable {
array_shift($muri);
$sub = array_shift($msubdomain) ?: null;
+ $rule[Router::RULE_VARIABLES]['_uri'] = $uri;
+ $rule[Router::RULE_VARIABLES]['_method'] = $method;
$rule[Router::RULE_VARIABLES]['_domain'] = static::getDomain();
$rule[Router::RULE_VARIABLES]['_subdomain'] = $sub;
$rule[Router::RULE_VARIABLES]['_call'] = &$rule[Router::RULE_CALL];