Class phery_response

Description

Standard response for the json parser

  • method: phery_response detach(): detach() Detach a DOM element retaining the events attached to it
  • method: phery_response prependTo(): pretendTo($target) Prepend DOM element to target
  • method: phery_response appendTo(): appendTo($target) Append DOM element to target
  • method: phery_response replaceWith(): replaceWith($newContent) The content to insert. May be an HTML string, DOM element, or jQuery object.
  • method: phery_response css(): css($propertyName, $value) propertyName: A CSS property name. value: A value to set for the property.
  • method: phery_response toggle(): toggle($speed) Toggle an object visible or hidden, can be animated with 'fast','slow','normal'
  • method: phery_response hide(): hide($speed) Hide an object, can be animated with 'fast','slow','normal'
  • method: phery_response show(): show($speed) Show an object, can be animated with 'fast','slow','normal'
  • method: phery_response toggleClass(): toggleClass($className) Add/Remove a class from an element
  • method: phery_response data(): data($name, $data) Add data to element
  • method: phery_response addClass(): addClass($className) Add a class from an element
  • method: phery_response removeClass(): removeClass($className) Remove a class from an element
  • method: phery_response animate(): animate($prop, $dur, $easing, $cb) Perform a custom animation of a set of CSS properties.
  • method: phery_response trigger(): trigger($eventName, [$args]) Trigger an event
  • method: phery_response triggerHandler(): triggerHandler($eventType, $extraParameters) Execute all handlers attached to an element for an event.
  • method: phery_response fadeIn(): fadeIn($prop, $dur, $easing, $cb) Animate an element
  • method: phery_response filter(): filter($selector) Reduce the set of matched elements to those that match the selector or pass the function's test.
  • method: phery_response fadeTo(): fadeTo($dur, $opacity) Animate an element
  • method: phery_response fadeOut(): fadeOut($prop, $dur, $easing, $cb) Animate an element
  • method: phery_response slideUp(): slideUp($dur, $cb) Hide with slide up animation
  • method: phery_response slideDown(): slideDown($dur, $cb) Show with slide down animation
  • method: phery_response slideToggle(): slideToggle($dur, $cb) Toggle show/hide the element, using slide animation
  • method: phery_response unbind(): unbind($name) Unbind an event from an element
  • method: phery_response undelegate(): undelegate() Remove a handler from the event for all elements which match the current selector, now or in the future, based upon a specific set of root elements.
  • method: phery_response stop(): stop() Stop animation on elements
  • method: phery_response live(): live($selector, $eventType, $handler ) Attach a handler to the event for all elements which match the current selector, now or in the future.
  • method: phery_response die(): die($name) Unbind an event from an element set by live()
  • method: phery_response val(): val($content) Set the value of an element
  • method: phery_response removeData(): removeData($name) Remove element data added with data()
  • method: phery_response removeAttr(): removeAttr($name) Remove an attribute from an element
  • method: phery_response scrollTop(): scrollTop($val) Set the scroll from the top
  • method: phery_response scrollLeft(): scrollLeft($val) Set the scroll from the left
  • method: phery_response height(): height($val) Set the height from the left
  • method: phery_response width(): width($val) Set the width from the left
  • method: phery_response slice(): slice($start, $end) Reduce the set of matched elements to a subset specified by a range of indices.
  • method: phery_response not(): not($val) Remove elements from the set of matched elements.
  • method: phery_response eq(): eq($selector) Reduce the set of matched elements to the one at the specified index.
  • method: phery_response offset(): offset($coordinates) Set the current coordinates of every element in the set of matched elements, relative to the document.
  • method: phery_response map(): map(callback($index, $domEl)) Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
  • method: phery_response children(): children($selector) Get the children of each element in the set of matched elements, optionally filtered by a selector.
  • method: phery_response closest(): closest($selector) Get the first ancestor element that matches the selector, beginning at the current element and progressing up through the DOM tree.
  • method: phery_response find(): find($selector) Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
  • method: phery_response next(): next($selector) Get the immediately following sibling of each element in the set of matched elements, optionally filtered by a selector.
  • method: phery_response nextAll(): nextAll($selector) Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
  • method: phery_response nextUntil(): nextUntil($selector) Get all following siblings of each element up to but not including the element matched by the selector.
  • method: phery_response parentsUntil(): parentsUntil($selector) Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector.
  • method: phery_response offsetParent(): offsetParent() Get the closest ancestor element that is positioned.
  • method: phery_response parent(): parent($selector) Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
  • method: phery_response parents(): parents($selector) Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
  • method: phery_response prev(): prev($selector) Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
  • method: phery_response prevAll(): prevAll($selector) Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
  • method: phery_response prevUntil(): prevUntil($selector) Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
  • method: phery_response siblings(): siblings($selector) Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
  • method: phery_response add(): add($selector) Add elements to the set of matched elements.
  • method: phery_response andSelf(): andSelf() Add the previous set of elements on the stack to the current set.
  • method: phery_response contents(): contents() Get the children of each element in the set of matched elements, including text nodes.
  • method: phery_response end(): end() End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
  • method: phery_response after(): after($content) Insert content, specified by the parameter, after each element in the set of matched elements.
  • method: phery_response before(): before($content) Insert content, specified by the parameter, before each element in the set of matched elements.
  • method: phery_response insertAfter(): insertAfter($target) Insert every element in the set of matched elements after the target.
  • method: phery_response insertbefore(): insertBefore($target) Insert every element in the set of matched elements before the target.
  • method: phery_response unwrap(): unwrap() Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
  • method: phery_response wrap(): wrap( $wrappingElement ) Wrap an HTML structure around each element in the set of matched elements.
  • method: phery_response wrapAll(): wrapAll( $wrappingElement ) Wrap an HTML structure around all elements in the set of matched elements.
  • method: phery_response wrapInner(): wrapInner( $wrappingElement ) Wrap an HTML structure around the content of each element in the set of matched elements.
  • method: phery_response delegate(): delegate($selector, $eventType, $handler ) Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
  • method: phery_response one(): one($selector, $eventType, $handler ) Attach a handler to an event for the elements. The handler is executed at most once per element.
  • method: phery_response bind(): bind($selector, $eventType, $handler ) Attach a handler to an event for the elements.
  • method: phery_response each(): each($function) Iterate over a jQ object, executing a function for each matched element.

Located in /phery.php (line 895)


	
			
Variable Summary
Method Summary
static phery_response factory ([string $selector = null])
phery_response __construct ([string $selector = null])
phery_response alert (string $msg)
phery_response append (string $content, [string $selector = null])
phery_response attr (string $attr,  $data, [string $selector = null])
phery_response call (string $func_name, mixed $args,...)
phery_response clear (string $attr, [string $selector = null])
phery_response cmd (int $cmd,  $args, [string $selector = null])
phery_response html (string $content, [string $selector = null])
phery_response j (string $selector)
phery_response jquery (string $selector)
phery_response prepend (string $content, [string $selector = null])
phery_response redirect (string $url)
phery_response remove ([string $selector = null])
string render ()
phery_response script (string|array $script)
phery_response text (string $content, [string $selector = null])
phery_response __call ( $name,  $arguments)
void __get ( $name)
void __set ( $name,  $value)
string __toString ()
Variables
string $last_selector = null (line 901)

Last jQuery selector defined

  • access: public
Methods
static method factory (line 929)

Create a new phery_response instance for chaining, for one liners

  1.  function answer()
  2.  {
  3.   return phery_response::factory('a#link')->attr('href''#')->alert('done');
  4.  }

static phery_response factory ([string $selector = null])
  • string $selector
Constructor __construct (line 912)
phery_response __construct ([string $selector = null])
  • string $selector: Create the object already selecting the DOM element
alert (line 988)

Show an alert box

phery_response alert (string $msg)
  • string $msg: Message to be displayed
append (line 1192)

Append string/HTML to target(s)

phery_response append (string $content, [string $selector = null])
  • string $content: Content to be appended to the selected element
  • string $selector: [optional] Optional jquery selector string
attr (line 1052)

Set the attribute of a jQuery selector

Example:

  1.  $phery_response->attr('href''http://url.com''a#link-' $args['id']);

phery_response attr (string $attr,  $data, [string $selector = null])
  • string $attr: HTML attribute of the item
  • string $selector: [optional] Provide the jQuery selector directly
  • $data
call (line 1070)

Call a javascript function.

Warning: calling this function will reset the selector jQuery selector previously stated

phery_response call (string $func_name, mixed $args,...)
  • string $func_name: Function name
  • mixed $args,...: Any additional arguments to pass to the function
clear (line 1091)

Clear the selected attribute.

Alias for attr('attrname', '')

phery_response clear (string $attr, [string $selector = null])
  • string $attr: Name of the attribute to clear, such as 'innerHTML', 'style', 'href', etc
  • string $selector: [optional] Provide the jQuery selector directly
cmd (line 1018)

Add a command to the response

phery_response cmd (int $cmd,  $args, [string $selector = null])
  • int $cmd: Integer for command, see phery.js for more info
  • array $args: Array to pass to the response
  • string $selector: Insert the jquery selector
html (line 1104)

Set the HTML content of an element.

Automatically typecasted to string, so classes that respond to __toString() will be converted automatically

phery_response html (string $content, [string $selector = null])
  • string $content
  • string $selector: [optional] Provide the jQuery selector directly
j (line 978)

Shortcut/alias for jquery($selector)

phery_response j (string $selector)
  • string $selector: Sets the current selector for subsequent chaining
jquery (line 967)

Sets the selector, so you can chain many calls to it

phery_response jquery (string $selector)
  • string $selector: Sets the current selector for subsequent chaining
    1.  $phery_response
    2.  ->jquery('.slides')
    3.  ->fadeTo(0,0)
    4.  ->css(array('top' => '10px''left' => '90px'));
merge (line 950)

Merge another response to this one.

Selectors with the same name will be added in order, for example:

  1.  function process()
  2.  {
  3.      $response->jquery('a.links')->remove()//from $response
  4.      // will execute before
  5.   // there will be no more "a.links", so the addClass() will fail silently
  6.      $response2->jquery('a.links')->addClass('red');
  7.      return $response->merge($response2);
  8.  }

phery_response merge (phery_response $phery)
prepend (line 1176)

Prepend string/HTML to target(s)

phery_response prepend (string $content, [string $selector = null])
  • string $content: Content to be prepended to the selected element
  • string $selector: [optional] Optional jquery selector string
redirect (line 1164)

Creates a redirect

phery_response redirect (string $url)
  • string $url: Complete url with http:// (according W3C http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30)
remove (line 1002)

Remove the current jQuery selector

phery_response remove ([string $selector = null])
  • string $selector: Set a selector
render (line 1257)

Return the JSON encoded data

string render ()
script (line 1144)

Compile a script and call it on-the-fly.

There is a closure on the executed function, so to reach out global variables, you need to use window.variable Warning: calling this function will reset the selector jQuery selector previously stated

phery_response script (string|array $script)
  • string|array $script: Script content. If provided an array, it will be joined with ;\n
    1.  ->script(array("if (confirm('Are you really sure?')) $('*').remove()"));
text (line 1122)

Set the text of an element.

Automatically typecasted to string, so classes that respond to __toString() will be converted automatically

phery_response text (string $content, [string $selector = null])
  • string $content
  • string $selector: [optional] Provide the jQuery selector directly
__call (line 1209)

Magically map to any additional jQuery function.

To reach this magically called functions, the jquery() selector must be called prior to any jquery specific call

phery_response __call ( $name,  $arguments)
  • $name
  • $arguments
__get (line 1241)

Magic function to get data appended to the response object

  • access: public
void __get ( $name)
  • $name
__set (line 1233)

Magic function to set data to the response before processing

  • access: public
void __set ( $name,  $value)
  • $name
  • $value
__toString (line 1267)

Return the JSON encoded data

if the object is typecasted as a string

string __toString ()

Documentation generated on Fri, 08 Jul 2011 23:01:35 -0300 by phpDocumentor 1.4.3