Permalink
Browse files

sending response with sendResponse()

  • Loading branch information...
1 parent ff52ee7 commit b72f98a862b6d38b6e918fa3b93dbf2bbc5773ec @pavelkouril committed Feb 26, 2011
Showing with 9 additions and 9 deletions.
  1. +9 −9 examples/nette/app/presenters/TexylaPresenter.php
@@ -47,7 +47,7 @@ public function actionPreview()
{
$texy = Environment::getService("Texy");
$html = $texy->process(Environment::getHttpRequest()->getPost("texy"));
- $this->terminate(new RenderResponse($html));
+ $this->sendResponse(new RenderResponse($html));
}
@@ -62,7 +62,7 @@ public function actionPreview()
*/
private function sendError($msg)
{
- $this->terminate(new JsonResponse(array(
+ $this->sendResponse(new JsonResponse(array(
"error" => $msg,
), "text/plain"));
}
@@ -176,7 +176,7 @@ public function actionListFiles($folder = "")
}
// send response
- $this->terminate(new JsonResponse(array(
+ $this->sendResponse(new JsonResponse(array(
"list" => array_merge($folders, $files),
)));
}
@@ -199,7 +199,7 @@ public function actionThumbnail($key)
Image::fromString(Image::EMPTY_GIF)->send(Image::GIF);
}
- $this->terminate();
+ $this->terminate()
}
@@ -246,7 +246,7 @@ public function actionUpload()
$this->payload->type = "file";
}
- $this->terminate(new JsonResponse($this->payload, "text/plain"));
+ $this->sendResponse(new JsonResponse($this->payload, "text/plain"));
} else {
$this->sendError("Move failed.");
}
@@ -265,7 +265,7 @@ public function actionMkDir($folder, $name)
$path = $this->getFolderPath($folder) . "/" . $name;
if (mkdir($path)) {
- $this->terminate(new JsonResponse(array(
+ $this->sendResponse(new JsonResponse(array(
"name" => $name,
)));
} else {
@@ -290,7 +290,7 @@ public function actionDelete($folder, $name)
if (is_dir($path)) {
if (rmdir($path)) {
- $this->terminate(new JsonResponse(array(
+ $this->sendResponse(new JsonResponse(array(
"deleted" => true,
)));
} else {
@@ -300,7 +300,7 @@ public function actionDelete($folder, $name)
if (is_file($path)) {
if (unlink($path)) {
- $this->terminate(new JsonResponse(array(
+ $this->sendResponse(new JsonResponse(array(
"deleted" => true,
)));
} else {
@@ -327,7 +327,7 @@ public function actionRename($folder, $oldname, $newname)
}
if (rename($oldpath, $newpath)) {
- $this->terminate(new JsonResponse(array(
+ $this->sendResponse(new JsonResponse(array(
"deleted" => true,
)));
} else {

0 comments on commit b72f98a

Please sign in to comment.