public function ImceFM::pageResponse in IMCE 8
Same name and namespace in other branches
- 8.2 src/ImceFM.php \Drupal\imce\ImceFM::pageResponse()
Returns a page response based on the current request.
File
- src/
ImceFM.php, line 694
Class
- ImceFM
- Imce File Manager.
Namespace
Drupal\imceCode
public function pageResponse() {
if ($request = $this->request) {
// Json request.
if ($request->request
->has('jsop')) {
$this
->run();
$data = $this
->getResponse();
// Return html response if the flag is set.
if ($request->request
->get('return_html')) {
return new Response('<html><body><textarea>' . Json::encode($data) . '</textarea></body></html>');
}
return new JsonResponse($data);
}
// Build and render the main page.
return new Response($this
->buildRenderPage());
}
}