function edit() { $this->load->library('geo/*'); $this->load->model('POIModel'); $this->load->model('POITypeModel'); $poiId = filter_input(INPUT_GET, 'poiId', FILTER_VALIDATE_INT); $poiObject = new stdClass(); $attrsObject = new stdClass(); if ($poiId !== NULL) { $poi = POIModel::load($poiId); $poiObject = $poi->toObject(); $attrsObject = $poi->attrs(); } $cats = POITypeModel::loadCats(); $subs = POITypeModel::loadSubs($poi->cat()); $nears = POIModel::loadNears($poi->latLng()); $countries = POIModel::loadCountries($poi->latLng()); $this->assign('poi', $poi->toObject()); $this->assign('nears', $nears); $this->assign('countries', $countries); $this->assign('cats', $cats); $this->assign('subs', $subs); $this->assign('attrs', $poi->attrs()); $this->load->view('templates/edit'); }