public function read() { $ld = new LocalDataModel(); $d = $ld->get('general'); $password = md5('123456'); //default if (isset($d['password'])) { $password = $d['password']; } return array('user' => 'admin', 'password' => $password); }
public function getAllData() { $ld = new LocalDataModel(); $all = $ld->all(); if (isset($all['general']['password'])) { unset($all['general']['password']); } if (isset($all['general']['weather'])) { $all['weather'] = $all['general']['weather']; unset($all['general']['weather']); } return $all; }