X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2FPlatal.php;h=43cf7765ab3cfae43c3e346eabbb1991e5b1d0ca;hb=d1ebc57a6035c4b43153dd85a34cfce19bc33026;hp=a05219305da0f366d342182355931979710744ce;hpb=04002fa130a79c9f2b4c052a3b8432b3ff0ee5da;p=platal.git diff --git a/classes/Platal.php b/classes/Platal.php index a052193..43cf776 100644 --- a/classes/Platal.php +++ b/classes/Platal.php @@ -46,6 +46,20 @@ class Platal } } + function pl_self($n = null) + { + if (is_null($n)) + return $this->path; + + if ($n >= 0) + return join('/', array_slice($this->argv, 0, $n + 1)); + + if ($n <= -count($this->argv)) + return $this->argv[0]; + + return join('/', array_slice($this->argv, 0, $n)); + } + function find_hook() { $p = $this->path;