Beispiel #1
0
 public function sendResponse(IResponse $response)
 {
     if ($this->tidy->isEnabled() && $response instanceof TextResponse && $response->getSource() instanceof ITemplate) {
         $response = new TidyResponse($response, $this->tidy);
     }
     parent::sendResponse($response);
 }
Beispiel #2
0
 public function sendResponse(Nette\Application\IResponse $response)
 {
     if ($response instanceof Nette\Application\Responses\TextResponse && $response->source instanceof Nette\Templating\ITemplate) {
         echo Helpers::renderTemplate($response->source);
     } else {
         parent::sendResponse($response);
     }
 }
 public static function tryJsonResponse(Presenter $presenter)
 {
     if (empty(self::$jsonResoponseItems)) {
         return;
     }
     $payload = array("type" => "JsonDependentSelectBoxResponse", "items" => array());
     foreach (self::$jsonResoponseItems as $item) {
         $payload["items"][$item->getHtmlId()] = array("selected" => $item->getValue(), "items" => $item->getItems());
     }
     $response = new JsonResponse($payload);
     $presenter->sendResponse($response);
 }
Beispiel #4
0
 public final function sendResponse(Application\IResponse $response)
 {
     if ($this->innerCall) {
         parent::sendResponse($response);
     }
     $this->amfManager->setResponse($response);
     if ($this->amfManager->hasMoreMessages()) {
         $request = $this->amfManager->createApplicationRequest();
         parent::sendResponse(new Application\Responses\ForwardResponse($request));
     } else {
         parent::sendResponse(new FinalResponse($this->amfManager));
     }
 }
Beispiel #5
0
 public function sendResponse(\Nette\Application\IResponse $response)
 {
     if ($response instanceof \Nette\Application\Responses\JsonResponse) {
         $response->send($this->getHttpRequest(), $this->getHttpResponse());
     } else {
         parent::sendResponse($response);
     }
 }