| Conditions | 6 |
| Paths | 9 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | public static function get($key, $data = null) |
||
| 8 | { |
||
| 9 | // if not $key |
||
| 10 | if (!$key) { |
||
| 11 | return null; |
||
| 12 | } |
||
| 13 | |||
| 14 | if ($data) { |
||
| 15 | foreach ($data as $var => $value) { |
||
| 16 | ${$var} = $value; |
||
| 17 | } |
||
| 18 | } |
||
| 19 | |||
| 20 | // load config file (this is only done once per application lifecycle) |
||
| 21 | if (!self::$texts) { |
||
| 22 | self::$texts = require('../application/config/texts.php'); |
||
| 23 | } |
||
| 24 | |||
| 25 | // check if array key exists |
||
| 26 | if (!array_key_exists($key, self::$texts)) { |
||
| 27 | return null; |
||
| 28 | } |
||
| 29 | |||
| 30 | return self::$texts[$key]; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |