JsHelper Class Reference

Inheritance diagram for JsHelper:

Overloadable2 Object Object

List of all members.


Public Member Functions

 alert_ ($message)
 confirm_ ($message)
 escape ($string)
 if_ ($if, $then, $else=null, $elseif=array())
 load_ ($url=null, $options=array())
 object ($data=array(), $block=false, $prefix= '', $postfix= '', $stringKeys=array(), $quoteKeys=true, $q="\"")
 prompt_ ($message, $default= '')
 real ($var)
 redirect_ ($url=null)
 select ($pattern)
 tryThese_ ($expr1, $expr2, $expr3)

Public Attributes

 $action = null
 $base = null
 $data = null
 $effectMap
 $helpers = array()
 $here = null
 $hook = null
 $output = false
 $params = null
 $plugin = null
 $themeWeb = null
 $webroot = null

Detailed Description

Definition at line 39 of file js.php.


Member Function Documentation

JsHelper::alert_ ( message  ) 

Definition at line 80 of file js.php.

JsHelper::confirm_ ( message  ) 

Definition at line 103 of file js.php.

JsHelper::escape ( string  ) 

Escape a string to be JavaScript friendly.

List of escaped ellements: + "\r\n" => '
' + "\r" => '
' + "\n" => '
' + '"' => '\"' + "'" => "\\'"

Parameters:
string $script String that needs to get escaped.
Returns:
string Escaped string.

Definition at line 186 of file js.php.

JsHelper::if_ ( if,
then,
else = null,
elseif = array() 
)

Definition at line 84 of file js.php.

References $out.

JsHelper::load_ ( url = null,
options = array() 
)

Loads a remote URL

Parameters:
string $url
array $options
Returns:
string

Definition at line 125 of file js.php.

References $url, and Router::url().

JsHelper::object ( data = array(),
block = false,
prefix = '',
postfix = '',
stringKeys = array(),
quoteKeys = true,
q = "\"" 
)

Generates a JavaScript object in JavaScript Object Notation (JSON) from an array

Parameters:
array $data Data to be converted
boolean $block Wraps return value in a <script> block if true
string $prefix Prepends the string to the returned data
string $postfix Appends the string to the returned data
array $stringKeys A list of array keys to be treated as a string
boolean $quoteKeys If false, treats $stringKey as a list of keys *not* to be quoted
string $q The type of quote to use
Returns:
string A JSON code block

Definition at line 223 of file js.php.

References $out.

JsHelper::prompt_ ( message,
default = '' 
)

Definition at line 107 of file js.php.

JsHelper::real ( var  ) 

Definition at line 199 of file js.php.

JsHelper::redirect_ ( url = null  ) 

Redirects to a URL

Parameters:
mixed $url
array $options
Returns:
string

Definition at line 170 of file js.php.

JsHelper::select ( pattern  ) 

Definition at line 195 of file js.php.

JsHelper::tryThese_ ( expr1,
expr2,
expr3 
)

Definition at line 116 of file js.php.


Member Data Documentation

JsHelper::$action = null

Definition at line 45 of file js.php.

JsHelper::$base = null

Definition at line 41 of file js.php.

JsHelper::$data = null

Definition at line 46 of file js.php.

JsHelper::$effectMap

Initial value:

 array(
        'Appear', 'Fade', 'Puff', 'BlindDown', 'BlindUp', 'SwitchOff', 'SlideDown', 'SlideUp',
        'DropOut', 'Shake', 'Pulsate', 'Squish', 'Fold', 'Grow', 'Shrink', 'Highlight', 'toggle'
    )

Definition at line 56 of file js.php.

JsHelper::$helpers = array()

Definition at line 50 of file js.php.

JsHelper::$here = null

Definition at line 43 of file js.php.

JsHelper::$hook = null

Definition at line 52 of file js.php.

JsHelper::$output = false

Definition at line 61 of file js.php.

JsHelper::$params = null

Definition at line 44 of file js.php.

JsHelper::$plugin = null

Definition at line 48 of file js.php.

JsHelper::$themeWeb = null

Definition at line 47 of file js.php.

JsHelper::$webroot = null

Definition at line 42 of file js.php.


The documentation for this class was generated from the following file: