PHP 8.5.10 Released!

Yaf_Dispatcher::getResponse

(Yaf >=1.0.0)

Yaf_Dispatcher::getResponseGet the response object

Описание

public function Yaf_Dispatcher::getResponse(): ?Yaf_Response_Abstract

Retrieve the Yaf_Response_Abstract instance used by the dispatcher.

Список параметров

Сигнатура функции не содержит параметров.

Возвращаемые значения

The Yaf_Response_Abstract instance, or null if the application is not initialized.

Примеры

Пример #1 Yaf_Dispatcher::getResponse() example

<?php
class CharsetPlugin extends Yaf_Plugin_Abstract
{
    public function preDispatch(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
    {
        // Same response object as the one held by the dispatcher
        Yaf_Dispatcher::getInstance()->getResponse()->setHeader(
            "Content-Type", "text/html; charset=utf-8"
        );
    }
}
?>

Смотрите также

Добавить

Примечания пользователей

Пользователи ещё не добавляли примечания для страницы
To Top