1 | <?php |
||
13 | class Text { |
||
|
|||
14 | use Module; |
||
15 | |||
16 | /** |
||
17 | * Fast string templating. |
||
18 | * Uses a Twig-like syntax. |
||
19 | * |
||
20 | * @example |
||
21 | * echo Text::render('Your IP is : {{ server.REMOTE_HOST }}',array('server' => $_SERVER)); |
||
22 | * |
||
23 | * @author Stefano Azzolini <[email protected]> |
||
24 | * @access public |
||
25 | * @static |
||
26 | * @param mixed $t The text template |
||
27 | * @param mixed $v (default: null) The array of values exposed in template. |
||
28 | * @return string |
||
29 | */ |
||
30 | public static function render($t,$v=null){ |
||
44 | |||
45 | /** |
||
46 | * Create a "slug", an url-safe sanitized string. |
||
47 | * |
||
48 | * @example |
||
49 | * echo Text::slugify("Thîs îs --- à vêry wrong séntènce!"); |
||
50 | * // this-is-a-very-wrong-sentence |
||
51 | * |
||
52 | * @access public |
||
53 | * @static |
||
54 | * @param string $text The text to slugify |
||
55 | * @return string The slug. |
||
56 | */ |
||
57 | public static function slugify($text){ |
||
62 | |||
63 | /** |
||
64 | * Translit accented characters to neutral ones |
||
65 | * |
||
66 | * @example |
||
67 | * echo Text::removeAccents("Thîs îs à vêry wrong séntènce!"); |
||
68 | * // This is a very wrong sentence! |
||
69 | * |
||
70 | * @access public |
||
71 | * @static |
||
72 | * @param string $text The text to translit |
||
73 | * @return string The translited text |
||
74 | */ |
||
75 | public static function removeAccents($text){ |
||
82 | |||
83 | } /* End of class */ |
||
84 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.