## Class TCallbackResponseAdapter

Description

TCallbackResponseAdapter alters the THttpResponse's outputs.

A TCallbackResponseWriter is used instead of the TTextWrite when createHtmlWriter is called. Each call to createHtmlWriter will create a new TCallbackResponseWriter. When flushContent() is called each instance of TCallbackResponseWriter's content is flushed.

The callback response data can be set using the ResponseData property.

- since: 3.1
- version: $Id: TCallbackResponseAdapter.php 2773 2010-02-17 13:55:18Z Christophe.Boulain $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

Located in /Web/UI/ActiveControls/TCallbackResponseAdapter.php (line 29)

    TComponent
       |
       --TApplicationComponent
          |
          --THttpResponseAdapter
             |
             --TCallbackResponseAdapter

Method Summary
void createNewHtmlWriter (string $type, THttpResponse $response)
void flushContent ()
string getRedirectedUrl ()
mixed getResponseData ()
void httpRedirect (string $url)
void setResponseData (mixed $data)
Methods
createNewHtmlWriter (line 48)

Returns a new instance of THtmlWriter.

An instance of TCallbackResponseWriter is created to hold the content.

- access: public

void createNewHtmlWriter (string $type, THttpResponse $response)

- string $type: writer class name.
- THttpResponse $response: http response handler.

Redefinition of:

THttpResponseAdapter::createNewHtmlWriter()
  This method is invoked when a new HtmlWriter needs to be created.

flushContent (line 58)

Flushes the contents in the writers.

- access: public

void flushContent ()

Redefinition of:

THttpResponseAdapter::flushContent()
  This method is invoked when the response flushes the content and headers.

getRedirectedUrl (line 95)

- return: new url for callback response to redirect to.
- access: public

string getRedirectedUrl ()
getResponseData (line 76)

- return: callback response data.
- access: public

mixed getResponseData ()
httpRedirect (line 85)

Delay the redirect until we process the rest of the page.

- access: public

void httpRedirect (string $url)

- string $url: new url to redirect to.

Redefinition of:

THttpResponseAdapter::httpRedirect()
  This method is invoked when the response is to redirect to another page.

setResponseData (line 68)

- access: public

void setResponseData (mixed $data)

- mixed $data: callback response data.

#### Inherited Methods

Inherited From THttpResponseAdapter

> THttpResponseAdapter::__construct()
> THttpResponseAdapter::createNewHtmlWriter()
> THttpResponseAdapter::flushContent()
> THttpResponseAdapter::getResponse()
> THttpResponseAdapter::httpRedirect()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Mon, 22 Feb 2010 12:16:59 +0000 by phpDocumentor 1.3.0RC4