uri_path .= strtolower($this->getService()->getClassName()) . '/'; $this->class_path = $this->getService()->getClassPath(); $this->title = lang("{$this->getService()->getClassPath()}.title"); $this->helper = $this->getHelper(); } final public function getService(): Service { if (!$this->_service) { $this->_service = new Service($this->request); } return $this->_service; } public function getHelper(): mixed { if (!$this->_helper) { $this->_helper = new Helper($this->request); } return $this->_helper; } public function getUserService(): UserService { if (!$this->_userService) { $this->_userService = new UserService($this->request); } return $this->_userService; } //Index,FieldForm관련 protected function getFormFieldOption(string $field, array $options = []): array { switch ($field) { case 'user_uid': $options[$field] = $this->getUserService()->getFormFieldOption($field); // echo $this->getUserModel()->getLastQuery(); // dd($options); break; default: $options = parent::getFormFieldOption($field, $options); break; } return $options; } //Index,FieldForm관련 //View관련 protected function view_process($uid): mixed { $fields = [ 'fields' => ['user_uid', 'class_name', 'method_name', $this->getService()->getModel()::TITLE, 'status', 'created_at', 'content'], ]; $this->init('view', $fields); return parent::view_process($uid); } protected function index_process(): array { $fields = [ 'fields' => ['user_uid', 'class_name', 'method_name', $this->getService()->getModel()::TITLE, 'status', 'created_at'], ]; $this->init('index', $fields); return parent::index_process(); } }