Class JavaScript (namespace Nette\Web)


PHP to JavaScript helper.

  1. 1:  $js new JavaScript;
  2. 2:  $js->jQuery('.prod img')
  3. 3:      ->css('position''relative')
  4. 4:      ->animate(array('top' => '100px'));
  5. 5:  echo $js;

Object
   |
   --JavaScript
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Web/JavaScript.php (line 42)
Public Method Summary
JavaScript
__construct ([$init = ''], [&$ref = NULL])
JavaScript
raw (mixed $arg)
Appends user expressions.
JavaScript
__call (string $method, array $args)
Calls JavaScript function.
JavaScript
__get (string $name)
Returns JavaScript property value.
void
__set (string $name, mixed $value)
Sets value of a JavaScript property.
string
Returns string represenation of JavaScript expression.
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
protected string $js

line 45


Method Details

line 51

__construct

public JavaScript __construct ([$init = ''], [&$ref = NULL])

Input
$init
&$ref
Output
JavaScript  

line 131

raw

public JavaScript raw (mixed $arg)

Appends user expressions.

Input
mixed $arg one or more parameters
Output
JavaScript provides a fluent interface

line 111

__call

public JavaScript __call (string $method, array $args)

Calls JavaScript function.

Input
string $method method name
array $args arguments
Output
JavaScript provides a fluent interface

line 87

__get

public JavaScript & __get (string $name)

Returns JavaScript property value.

Input
string $name property name
Output
JavaScript provides a fluent interface

line 65

__set

public void __set (string $name, mixed $value)

Sets value of a JavaScript property.

Input
string $name property name
mixed $value property value
Output
void  

line 146

__toString

public string __toString ()

Returns string represenation of JavaScript expression.

Output
string