Zend フレームワークで ajax 応答を送信する場合、Zend_Controller_Request_Http オブジェクトを使用して本文を設定し、単純な echo ステートメントとは対照的に応答を送信する利点は何ですか。
例えば:
$response->setBody('content');
//somewhere later in the application
$response->sendResponse();
対
echo 'content';
Zend フレームワークで ajax 応答を送信する場合、Zend_Controller_Request_Http オブジェクトを使用して本文を設定し、単純な echo ステートメントとは対照的に応答を送信する利点は何ですか。
例えば:
$response->setBody('content');
//somewhere later in the application
$response->sendResponse();
対
echo 'content';