nyroFwk  0.2
tr.class.php
Go to the documentation of this file.
1 <?php
10 final class tr {
11 
17  private static $cfg;
18 
22  private function __construct() {}
23 
27  private static function initCfg() {
28  if (!self::$cfg)
29  self::$cfg = new config(factory::loadCfg(__CLASS__));
30  }
31 
40  public static function __($key, $show=false, $out=true) {
41  self::initCfg();
42  $ret = null;
43  if (strpos($key, '_') !== false) {
44  $keys = explode('_', $key);
45  $ret = self::$cfg->getInArray($keys[0], $keys[1]);
46  } else
47  $ret = self::$cfg->get($key);
48 
49  if ($out)
50  $ret = utils::htmlOut($ret);
51 
52  if (is_array($ret))
53  $ret = array_map('nl2br', $ret);
54  else
55  $ret = nl2br($ret);
56 
57  if ($show)
58  echo $ret;
59  else
60  return $ret;
61  }
62 }
static htmlOut($val, $key=false)
static __($key, $show=false, $out=true)
Definition: tr.class.php:40
static initCfg()
Definition: tr.class.php:27
static loadCfg($className, $searchParent=true)
Definition: tr.class.php:10
__construct()
Definition: tr.class.php:22
static $cfg
Definition: tr.class.php:17
Generated on Sun Oct 15 2017 22:25:20 for nyroFwk by doxygen 1.8.13