setPath('defence'); } // public function getDefenceService(): DefenceService { if ($this->_clientService === null) { $this->_clientService = new DefenceService(); } return $this->_clientService; } //방어 defense_index.php //CLI 접속방법 : php index.php site/defence/index/zone/존/parent/부모키/child/자식키 //WEB 접속방법 : http://localhost/site/defence/index/zone/존/parent/부모키/child/자식키 public function index() { $zone = $this->request->get('zone'); if (!$zone) { throw new \Exception("zone 값이 정의되지 않았습니다."); } $this->zone = urldecode($zone); $this->getDefenceService()->getModel()->where(['zone' => $this->zone]); $this->getDefenceService()->getModel()->orderBy(['zone' => 'asc', 'parents' => 'asc', 'child' => 'asc']); $this->curPage = intval($this->request->get('curPage', 1)); $this->perPage = intval($this->request->get('perPage', APP_VIEW_LIST_PERPAGE)); [$this->total, $this->entities] = $this->getDefenceService()->getList($this->curPage, $this->perPage); $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); return $this->render(__FUNCTION__); } } //Class