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

Class: HTML_AJAX

Source Location: /HTML_AJAX-0.2.4/AJAX.php

Class Overview


OO AJAX Implementation for PHP


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 Joshua Eichorn

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 35]
OO AJAX Implementation for PHP


[ Top ]


Class Variables

$contentTypeMap = array(
            'JSON'  => 'application/json',
            'Null'  => 'text/plain',
            'Error' => 'application/error',
        )

[line 83]

Content-type map

Used in to automatically choose serializers as needed


Type:   mixed


[ Top ]

$debug =

[line 95]

This is the debug variable that we will be passing the HTML_AJAX_Debug instance to.

Type:   mixed


[ Top ]

$debugEnabled =  false

[line 101]

This is to tell if debug is enabled or not. If so, then debug is called, instantiated then saves the file and such.

Type:   mixed


[ Top ]

$debugSession =  false

[line 109]

This puts the error into a session variable is set to true.

set to false by default.

  • Access: public

Type:   mixed


[ Top ]

$serializer =  'JSON'

[line 70]

What encoding your going to use for serializing data from php being sent to javascript
  • Var: JSON|null

Type:   string


[ Top ]

$serverUrl =  false

[line 64]

Set the server url in the generated stubs to this value

If set to false, serverUrl will not be set


Type:   false|string


[ Top ]

$unserializer =  'JSON'

[line 76]

What encoding your going to use for unserializing data sent from javascript
  • Var: JSON|null

Type:   string


[ Top ]



Method Detail

generateClassStub   [line 205]

string generateClassStub( string $name)

Return the stub for a class
  • Return: javascript proxy stub code for a single class

Parameters:

string   $name   —  name of the class to generated the stub for, note that this is the exported name not the php class name

[ Top ]

generateJavaScriptClient   [line 167]

string generateJavaScriptClient( )

Generate the client Javascript code
  • Return: generated javascript client code

[ Top ]

handleRequest   [line 256]

boolean handleRequest( )

Handle a ajax request if needed

The current check is if GET variables c (class) and m (method) are set, more options may be available in the future

  • Return: true if an ajax call was handled, false otherwise
  • Todo: is it worth it to figure out howto use just 1 instance if the type is the same for serialize and unserialize

[ Top ]

registerCallback   [line 181]

void registerCallback( $callback, [ $type = 'headers'])

Registers callbacks for sending headers or retriving post/get vars

for better application integration


Parameters:

   $callback   — 
   $type   — 

[ Top ]

registerClass   [line 119]

void registerClass( &$instance, [string|bool $exportedName = false], [array|bool $exportedMethods = false], object $instance)

Set a class to handle requests

Parameters:

object   $instance   — 
string|bool   $exportedName   —  Name used for the javascript class, if false the name of the php class is used
array|bool   $exportedMethods   —  If false all functions without a _ prefix are exported, if an array only the methods listed in the array are exported
   &$instance   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:11:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.