1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php namespace Maze\Config;
- use Maze\Config\Load as Config;
- class Lang
- {
- /**
- * get
- * @param string $type
- *
- * @return array
- */
- static public function get($key = 'host', $param = '')
- {
- $name = 'lang/' . Config::$global['base']['lang'];
- Config::get($name);
- if(isset(Config::$global[$name][$key]))
- {
- if($param)
- {
- if(is_string($param))
- {
- $param = array($param);
- }
- foreach($param as $k => $v)
- {
- $k = '{' . $k . '}';
- if(strpos(Config::$global[$name][$key], $k) !== false)
- {
- Config::$global[$name][$key] = str_replace($k, $v, Config::$global[$name][$key]);
- }
- }
- }
- return Config::$global[$name][$key];
- }
- return $key;
- }
- }
|