AJAX
[ class tree: AJAX ] [ index: AJAX ] [ all elements ]

Source for file Response.php

Documentation is available at Response.php

  1. <?php
  2. /**
  3.  * OO AJAX Implementation for PHP, contains HTML_AJAX_Response
  4.  *
  5.  * @category   HTML
  6.  * @package    AJAX
  7.  * @author     Elizabeth Smith <auroraeosrose@gmail.com>
  8.  * @copyright  2005-2006 Elizabeth Smith
  9.  * @license    http://www.opensource.org/licenses/lgpl-license.php  LGPL
  10.  * @version    Release: @package_version@
  11.  */
  12.  
  13. /**
  14.  * Require the main AJAX library
  15.  */
  16. require_once 'HTML/AJAX.php';
  17.  
  18. /**
  19.  * Simple base class for a response object to use as an ajax callback
  20.  *
  21.  * This is the base response class, more interesting response classes can be
  22.  * built off of this, simply give it a unique content type and override the
  23.  * getPayload method or fill the payload property with your extended classes's
  24.  * serialized content
  25.  *
  26.  * @version   $Id: Response.php 536 2006-08-12 01:05:54Z emsmith $
  27.  */
  28. {
  29.  
  30.     /**
  31.      * The base response class uses plain text so use that content type
  32.      *
  33.      * @var string 
  34.      * @access public
  35.      */
  36.     var $contentType = 'text/plain';
  37.  
  38.     /**
  39.      * Assign a string to this variable to use the bare response class
  40.      *
  41.      * @var string 
  42.      * @access public
  43.      */
  44.     var $payload = '';
  45.  
  46.     /**
  47.      * Returns the appropriate content type
  48.      *
  49.      * This normally simply returns the contentType property but can be overridden
  50.      * by an extending class if the content-type is variable
  51.      *
  52.      * @return  string   appropriate content type
  53.      * @access public
  54.      */
  55.     function getContentType()
  56.     {
  57.         return $this->contentType;
  58.     }
  59.  
  60.     /**
  61.      * Returns the serialized content of the response class
  62.      *
  63.      * You can either fill the payload elsewhere in an extending class and leave
  64.      * this method alone, or you can override it if you have a different type
  65.      * of payload that needs special treatment
  66.      *
  67.      * @return  string   serialized response content
  68.      * @access public
  69.      */
  70.     function getPayload()
  71.     {
  72.         return $this->payload;
  73.     }
  74. }
  75. ?>

Documentation generated on Sat, 05 May 2007 18:00:20 -0400 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.