1: setOutput is a method of the Response class at the address `site / library / response.php.
In general, almost everything that $ this-> and not from the current class is from the site / library /
2: The method is responsible for transferring data (what and where):
Это определение файла представления карты товара в контроллере и передача "в него" массива $data с данными товара. if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/product.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/product/product.tpl', $data)); } Это окончание метода autocomplete(), который реагирует на ввод в инпуте символов и возвращает значения для подстановки. $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json));
In the first case, it works as a router, denoting which presentation file to choose for rendering the called route and transferring data to it. In the second case, it works as a return method (function), giving the data to the already drawn view file.