lang() 함수의 langType 기능 제거

This commit is contained in:
conory 2016-03-06 23:42:06 +09:00
parent f44c02b558
commit 0e99f8eb44

View file

@ -32,7 +32,7 @@ function config($key, $value = null)
* @param string $value `$code`s value * @param string $value `$code`s value
* @return mixed * @return mixed
*/ */
function lang($code = null, $value = null) function lang($code, $value = null)
{ {
if (!$GLOBALS['lang'] instanceof Rhymix\Framework\Lang) if (!$GLOBALS['lang'] instanceof Rhymix\Framework\Lang)
{ {
@ -40,17 +40,13 @@ function lang($code = null, $value = null)
$GLOBALS['lang']->loadDirectory(RX_BASEDIR . 'common/lang', 'common'); $GLOBALS['lang']->loadDirectory(RX_BASEDIR . 'common/lang', 'common');
} }
if ($code !== null && $value === null) if ($value === null)
{ {
return $GLOBALS['lang']->get($code); return $GLOBALS['lang']->get($code);
} }
else if ($code !== null && $value !== null)
{
$GLOBALS['lang']->set($code, $value);
}
else else
{ {
return $GLOBALS['lang']->langType(); $GLOBALS['lang']->set($code, $value);
} }
} }