Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8877679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:31:24+00:00 2026-06-14T19:31:24+00:00

When sending an ajax response in the zend framework what is the benefit of

  • 0

When sending an ajax response in the zend framework what is the benefit of using a Zend_Controller_Request_Http object and setting the body and then sending the response as opposed to a simple echo statement.

For example:

$response->setBody('content');

//somewhere later in the application
$response->sendResponse();

versus

echo 'content';
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:31:26+00:00Added an answer on June 14, 2026 at 7:31 pm

    Using Response object instead of direct output is crucial for good application design.
    For example, consider situation where you will want to introduce some sort of post-processing to your output, may be sign it with cert:
    you can merely attach listener at some point in your application and all you care about is Response object, no need to think how to catch output echoed somewhere in application

    There is actually a lot of reason to use it and little to no reasons not to.
    Most obvious is that you can attach or change headers at any point in your application.
    Most important is that it gives you flexibility in how you can work with output.

    Note:
    I want to make clarification for later viewers: there is no point to set and immediately send Response object content, it is usually carried throughout the application and call to sendResponse() is the one of the latest actions in request life cycle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have issue with sending AJAX body request using jQuery CORS with custom Content-type.
I sending ajax request from a jQuery file like below, which expects response in
I am sending an AJAX request to server and retrieving a response as a
I am sending an Ajax Request using jQuery. What happens is that I am
I'm sending an AJAX request to another domain, and it's sending me a response
I have an ajax query sending to a php script and putting the response
When I'm sending AJAX query to my webApp, Qooxdoo cannot interpret the response correctly
Sending request to action using Ajax, the result type is json. Use a json
I am using IE8 and I am sending ajax request to on of the
I am sending an AJAX request using javascript to a servlet. The servlet is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.