ManiaLib 1.0b1 API Reference

Source for file Route.class.php

Documentation is available at Route.class.php

  1. <?php
  2. /**
  3.  * @author Maxime Raoust
  4.  * @copyright 2009-2010 NADEO
  5.  * @package ManiaLib
  6.  * @subpackage MVC
  7.  */
  8.  
  9. /**
  10.  * Route class
  11.  * 
  12.  * @package ManiaLib
  13.  * @subpackage MVC
  14.  */
  15. abstract class Route
  16. {
  17.     /**
  18.      * Use current
  19.      */
  20.     const CUR = -1;
  21.     /**
  22.      * Use default
  23.      */
  24.     const DEF = -2;
  25.     /**
  26.      * Don't use anything
  27.      */
  28.     const NONE = -3;
  29.     
  30.     /**
  31.      * @ignore
  32.      */
  33.     static function separatorToUpperCamelCase($string)
  34.     {
  35.         return implode(''array_map('ucfirst'explode(APP_MVC_URL_SEPARATOR$string)));
  36.     }
  37.     
  38.     /**
  39.      * @ignore
  40.      */
  41.     static function separatorToCamelCase($string)
  42.     {
  43.         $string implode(''array_map('ucfirst'explode(APP_MVC_URL_SEPARATOR$string)));
  44.         $string[0strtolower($string[0]);
  45.         return $string;
  46.     }
  47.     
  48.     /**
  49.      * @ignore
  50.      */
  51.     static function camelCaseToSeparator($string)
  52.     {
  53.         return strtolower(preg_replace('/([^A-Z])([A-Z])/''$1'.APP_MVC_URL_SEPARATOR.'$2'$string))
  54.     }
  55. }
  56.  
  57. ?>