Xpressengine\Translation\LangData::setData PHP Method

setData() public method

public setData ( array $data ) : void
$data array 다국어 데이터
return void
    public function setData($data)
    {
        foreach (array_dot($data) as $key => $value) {
            $arrKey = explode('.', $key);
            $locale = array_pop($arrKey);
            $item = implode($arrKey, '.');
            $this->setLine($item, $locale, $value);
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param string $source 데이터 소스
  * @return LangData
  */
 public function load($source)
 {
     $data = $this->files->getRequire($source);
     $langData = new LangData();
     $langData->setData($data);
     return $langData;
 }
All Usage Examples Of Xpressengine\Translation\LangData::setData