Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 22423 программиста и 1057 роботов. Сейчас ищут 719 программистов ...
Приступая к работе

Yaf_Response_Abstract::setBody - Set content to response

Вернуться к: Yaf_Response_Abstract

Yaf_Response_Abstract::setBody

(Yaf >=1.0.0)

Yaf_Response_Abstract::setBodySet content to response

Описание

public bool Yaf_Response_Abstract::setBody ( string $content [, string $key ] )

Set content to response

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

body

content string

key

the content key, you can set a content with a key, if you don't specific, then Yaf_Response_Abstract::DEFAULT_BODY will be used

Замечание:

this parameter is introduced as of 2.2.0

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

Примеры

Пример #1 Yaf_Response_Abstract::setBody()example

<?php
$response 
= new Yaf_Response_Http();

$response->setBody("Hello")->setBody(" World""footer");

print_r($response);
echo 
$response;
?>

Результатом выполнения данного примера будет что-то подобное:

Yaf_Response_Http Object
(
    [_header:protected] => Array
        (
        )

    [_body:protected] => Array
        (
            [content] => Hello
            [footer] =>  World
        )

    [_sendheader:protected] => 1
    [_response_code:protected] => 200
)
Hello World

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



Вернуться к: Yaf_Response_Abstract

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware