f2faac3767e6bdff24837df82456ee7a38c0954b.svn-base 764 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php namespace Maze\Config;
  2. use Maze\Config\Load as Config;
  3. class Lang
  4. {
  5. /**
  6. * get
  7. * @param string $type
  8. *
  9. * @return array
  10. */
  11. static public function get($key = 'host', $param = '')
  12. {
  13. $name = 'lang/' . Config::$global['base']['lang'];
  14. Config::get($name);
  15. if(isset(Config::$global[$name][$key]))
  16. {
  17. if($param)
  18. {
  19. if(is_string($param))
  20. {
  21. $param = array($param);
  22. }
  23. foreach($param as $k => $v)
  24. {
  25. $k = '{' . $k . '}';
  26. if(strpos(Config::$global[$name][$key], $k) !== false)
  27. {
  28. Config::$global[$name][$key] = str_replace($k, $v, Config::$global[$name][$key]);
  29. }
  30. }
  31. }
  32. return Config::$global[$name][$key];
  33. }
  34. return $key;
  35. }
  36. }