public function action_index() { //Load Config $dataType = \Config::load('api', 'api')['data-type']; //Get Paramator $getDataType = \Input::post('dataType') ? \Input::post('dataType') : 1; //Get MemData $mem = new Mem(); $data['result'] = $mem->memRead($dataType[$getDataType]); $data['dataType'] = $getDataType; $this->template->title = 'Top » Index'; $this->template->content = \View::forge('top/index', $data); }
/** * 現在走行中の全列車情報 * @param $metro * @return array */ public function get_trainAllInfo() { //Load Config : $dataType = \Config::load('api', 'api')['data-type'][1]; //Get MemData $mem = new Mem(); $data = $mem->memRead($dataType); foreach ($data as $key => $value) { $responseData[] = array('_id' => $value['@id'], 'railway' => strrchr($value['odpt:railway'], 'TokyoMetro'), 'trainType' => strrchr($value['odpt:trainType'], 'TokyoMetro'), 'delay' => strrchr($value['odpt:delay'], 'TokyoMetro'), 'startingStation' => strrchr($value['odpt:startingStation'], 'TokyoMetro'), 'terminalStation' => strrchr($value['odpt:terminalStation'], 'TokyoMetro'), 'fromStation' => strrchr($value['odpt:fromStation'], 'TokyoMetro'), 'toStation' => strrchr($value['odpt:toStation'], 'TokyoMetro'), 'railDirection' => strrchr($value['odpt:railDirection'], 'TokyoMetro'), 'trainOwner' => strrchr($value['odpt:trainOwner'], 'TokyoMetro')); } return $this->response($responseData); }