Class: HTML_AJAX_Action
Source Location: /HTML_AJAX-0.5.5/AJAX/Action.php
HTML_AJAX_Response
|
--HTML_AJAX_Action
Helper class to eliminate the need to write javascript functions to deal with data
Author(s):
Version:
- $Id: Action.php 537 2006-08-12 01:48:12Z emsmith $
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
appendAttr [line 99]
void appendAttr(
string
$id, string|array
$attribute, [mixed
$data = NULL])
|
|
Appends data to the attribute identified by id The data will be added to the end of the attribute identified by the id sent, id must be unique $response->appendAttr('myid', 'class', 'red'); $response->appendAttr('myid', array('class' => 'red', 'innerHTML' => 'this is an error'));
Parameters:
assignAttr [line 128]
void assignAttr(
string
$id, string|array
$attribute, [mixed
$data = NULL])
|
|
Assigns data to the attribute identified by id overwriting any previous values The data will be assigned to the attribute identified by the id sent, id must be unique $response->assignAttr('myid', 'class', 'red'); $response->assignAttr('myid', array('class' => 'red', 'innerHTML' => 'this is an error'));
Parameters:
clearAttr [line 155]
void clearAttr(
string
$id, string|array
$attribute)
|
|
Deletes or assigns a value of an empty string to an attribute You may send either a single attribute or an array of attributes to clear $response->clearAttr('myid', 'class'); $response->clearAttr('myid', array('class', 'innerHTML'));
Parameters:
combineActions [line 323]
array combineActions(
&$instance, object
$instance)
|
|
Adds all the actions from one response object to another, feature request #6635 at pear.php.net
Parameters:
createNode [line 197]
void createNode(
string
$id, string
$tag, array
$attributes, [
$type = 'append'])
|
|
create a dom node via javascript higher level dom manipulation - creates a new node to insert into the dom You can control where the new node is inserted with two things, the insertion type and the id/ The type should be append, prepend, insertBefore, or insertAfter The id is a sibling node - like a div in the same div you want to add more to If you choose to append or prepend a node it will be placed at the beginning or end of the node with the id you send. If you choose insertBefore or InsertAfter it will be put right before or right after the node you specified. You can send an array of attributes to apply to the new node as well, so you don't have to create it and then assign Attributes. $response->createNode('myid', 'div'); $response->createNode('submit', 'input', array('id' => 'key', 'name' => 'key', 'type' => 'hidden', 'value' => $id), 'insertBefore');
Parameters:
getPayload [line 309]
Returns the serialized content of the response class we actually use the json serializer underneath, so we send the actions array to the json serializer and return the data
Overrides HTML_AJAX_Response::getPayload() (Returns the serialized content of the response class)
insertAlert [line 291]
void insertAlert(
string
$data)
|
|
Send a string to a javascript alert This will send the data right to the alert javascript function
Parameters:
insertScript [line 273]
void insertScript(
string
$data)
|
|
Send a string to a javascript eval This will send the data right to the eval javascript function, it will NOT allow you to dynamically add a javascript function for use later on because it is constrined by the eval function
Parameters:
prependAttr [line 69]
void prependAttr(
string
$id, string|array
$attribute, [mixed
$data = NULL])
|
|
Prepends data to the attribute identified by id The data will be added to the beginning of the attribute identified by the id sent, id must be unique $response->prependAttr('myid', 'class', 'red'); $response->prependAttr('myid', array('class' => 'red', 'innerHTML' => 'this is an error'));
Parameters:
removeNode [line 253]
void removeNode(
string
$id)
|
|
Delete a dom node via javascript $response->removeNode('myid'); $response->removeNode(array('mydiv', 'myform'));
Parameters:
replaceNode [line 231]
void replaceNode(
string
$id, string
$tag, array
$attributes)
|
|
Replace a dom node via javascript higher level dom manipulation - replaces one node with another This can be used to replace a div with a form for inline editing use innerHtml attribute to change inside text $response->replaceNode('myid', 'div', array('innerHTML' => 'loading complete')); $response->replaceNode('mydiv', 'form', array('innerHTML' => $form));
Parameters:
retrieveActions [line 335]
to follow proper property access we need a way to retrieve the private actions array
Documentation generated on Mon, 11 Mar 2019 15:19:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|