ソースを参照

Fix E_STRICT failure in i18n example.

Justin Hileman 13 年 前
コミット
9693695d2b
1 ファイル変更4 行追加4 行削除
  1. 4 4
      examples/i18n/I18n.php

+ 4 - 4
examples/i18n/I18n.php

@@ -9,12 +9,12 @@ class I18n extends Mustache {
     public $__ = array(__CLASS__, '__trans');
 
     // A *very* small i18n dictionary :)
-    private $dictionary = array(
+    private static $dictionary = array(
         'Hello.' => 'Hola.',
         'My name is {{ name }}.' => 'Me llamo {{ name }}.',
     );
 
-    public function __trans($text) {
-        return isset($this->dictionary[$text]) ? $this->dictionary[$text] : $text;
+    public static function __trans($text) {
+        return isset(self::$dictionary[$text]) ? self::$dictionary[$text] : $text;
     }
-}
+}