Move examples into the test fixtures.

This commit is contained in:
Justin Hileman
2012-03-26 19:05:08 -07:00
parent 99a5e9b14a
commit 1430b27f86
77 changed files with 7 additions and 10 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
class I18n {
// Variable to be interpolated
public $name = 'Bob';
// Add a {{#__}} lambda for i18n
public $__ = array(__CLASS__, '__trans');
// A *very* small i18n dictionary :)
private static $dictionary = array(
'Hello.' => 'Hola.',
'My name is {{ name }}.' => 'Me llamo {{ name }}.',
);
public static function __trans($text) {
return isset(self::$dictionary[$text]) ? self::$dictionary[$text] : $text;
}
}
+1
View File
@@ -0,0 +1 @@
{{#__}}Hello.{{/__}} {{#__}}My name is {{ name }}.{{/__}}
+1
View File
@@ -0,0 +1 @@
Hola. Me llamo Bob.