本文整理汇总了PHP中Nette\Application\UI\Presenter::sendResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP Presenter::sendResponse方法的具体用法?PHP Presenter::sendResponse怎么用?PHP Presenter::sendResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Presenter
的用法示例。
在下文中一共展示了Presenter::sendResponse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendResponse
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);
}
示例2: sendResponse
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);
}
}
示例3: tryJsonResponse
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);
}
示例4: sendResponse
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));
}
}
示例5: sendResponse
public function sendResponse(\Nette\Application\IResponse $response)
{
if ($response instanceof \Nette\Application\Responses\JsonResponse) {
$response->send($this->getHttpRequest(), $this->getHttpResponse());
} else {
parent::sendResponse($response);
}
}