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) Animate an element
  • method: phery_response trigger(): trigger($eventName, [$args]) Trigger an event
  • method: phery_response fadeIn(): fadeIn($prop, $dur, $easing, $cb) Animate an element
  • method: phery_response filter(): filter($selector) Filter elements
  • 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 stop(): stop() Stop animation on elements
  • method: phery_response live(): live($name) Bind a live event to the selected elements
  • 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($element, $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.

Located in /phery.php (line 685)


	
			
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 ([ $selector = null], string $children_selector)
void 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)
void __toString ()
Variables
string $last_selector = null (line 690)
  • access: public
Methods
static method factory (line 730)

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 700)
phery_response __construct ([string $selector = null])
  • string $selector: Create the object already selecting the DOM element
alert (line 782)

Show an alert box

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

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 846)

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 863)

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 883)

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 812)

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 895)

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 772)

Shortcut/alias for jquery($selector)

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

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
merge (line 750)

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.      $response2->jquery('a.links')->addClass('red')// there will be no more "a.links", so the addClass() will fail silently
  6.      return $response->merge($response2);
  7.  }

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

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 952)

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 796)

Remove the current jQuery selector

phery_response remove ([ $selector = null], string $children_selector)
  • string $children_selector: Set a children selector
  • $selector
render (line 1041)
void render ()
script (line 932)

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.  phery_response::factory()->script(array("if (confirm('Are you really sure?')) $('*').remove()"));
text (line 912)

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 997)

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 1029)

Magic function to get data appended to the response object

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

Magic function to set data to the response before processing

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

Documentation generated on Sun, 01 May 2011 12:30:30 -0300 by phpDocumentor 1.4.3