
Yaf_Response_Abstract::setAllHeaders 메서드는 모든 HTTP 헤더를 설정할 수 있습니다.
이 메서드는 배열 형식으로 헤더를 설정해야 합니다. 예를 들어, Content-Type을 설정하려면 다음과 같이 코드를 작성할 수 있습니다.
#hostingforum.kr
php
$response = new Yaf_Response_Abstract();
$response->setAllHeaders(array(
'Content-Type' => 'text/html; charset=UTF-8',
));
또는, 여러 헤더를 한 번에 설정할 수 있습니다.
#hostingforum.kr
php
$response = new Yaf_Response_Abstract();
$headers = array(
'Content-Type' => 'text/html; charset=UTF-8',
'Cache-Control' => 'no-cache',
'Pragma' => 'no-cache',
);
$response->setAllHeaders($headers);
Yaf 프레임워크의 공식 문서는 Yaf 홈페이지에서 확인할 수 있습니다.
2025-08-06 21:59