2017 © Pedro Peláez
 

library pathtranslator

stpped updating...

image

phanda/pathtranslator

stpped updating...

  • Wednesday, June 20, 2012
  • by k-holy
  • Repository
  • 1 Watchers
  • 2 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Phanda_PathTranslator

This class supports cool URI., (*1)

Examples

/.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* __gateway.php [L]

/__gateway.php

<?php
Phanda_PathTranslator::getInstance()->initialize()
->setParameterDirectoryName('%VAR%')
->setSearchExtensions('php')
->execute();

If /categories/1/items/2/detail.json is requested,, (*2)

directory is changed to /categories/%VAR%/items/%VAR%/ in the document root and detail.php is included., (*3)

And then environment variables (PHP_SELF, SCRIPT_NAME, SCRIPT_FILENAME, PATH_INFO, PATH_TRANSLATED) is rewritten., (*4)

/categories/%VAR%/items/%VAR%/detail.php

<?php
$translator = Phanda_PathTranslator::getInstance();
$categoryId = $translator->getParameter(0); // '1'
$itemId     = $translator->getParameter(1); // '2'
$extension  = $translator->getExtension();  // 'json'

This project stopped updating. https://github.com/k-holy/Volcanus_Routing inherits this project., (*5)

The Versions

20/06 2012

dev-master

9999999-dev https://github.com/k-holy/Phanda_PathTranslator

stpped updating...

  Sources   Download

MIT

The Requires

  • php >=5.2

 

by Avatar k-holy