System.Web.UI
[ class tree: System.Web.UI ] [ index: System.Web.UI ] [ all elements ]

Class: TJavascript

Source Location: /Web/UI/TJavascript.php

Class Overview


TJavascript class file. Javascript utilties, converts basic PHP types into appropriate javascript types.

Class Details

[line 38]
TJavascript class file. Javascript utilties, converts basic PHP types into appropriate javascript types.

Example:

  1. $options['onLoading'] = "doit";
  2. $options['onComplete'] = "more";
  3. $js = TJavascript::toList($options);
  4. //expects the following javascript code

Namespace: System.Web.UI




version:  $Revision: 1.3 $ $Date: 2005/11/10 23:43:26 $
author:  Wei Zhuo<weizhuo[at]gmail[dot]com>


[ Top ]

Methods



Class Methods


method render [line 43]

void render( mixed $code)

Render a block of of javavscript code within a javascript tag.



static:  
access:  public


[ Top ]

method toArray [line 60]

string toArray( array $array, [string $append = null], [boolean $strict = false])

Coverts PHP arrays (only the array values) into javascript array.



return:  javascript array as string.
static:  
access:  public


Parameters:

array   $array   the array data to convert
string   $append   append additional javascript array data
boolean   $strict   if true empty string and empty array will be converted

[ Top ]

method toList [line 88]

string toList( array $array, [string $append = null], [boolean $strict = false])

Coverts PHP arrays (both key and value) into javascript objects.



return:  javascript object as string.
static:  
access:  public


Parameters:

array   $array   the array data to convert
string   $append   append additional javascript object data
boolean   $strict   if true empty string and empty array will be converted

[ Top ]

method to_array [line 142]

void to_array( mixed $v)



access:  public


[ Top ]

method to_boolean [line 110]

void to_boolean( mixed $v)



access:  public


[ Top ]

method to_double [line 120]

void to_double( mixed $v)



access:  public


[ Top ]

method to_integer [line 115]

void to_integer( mixed $v)



access:  public


[ Top ]

method to_null [line 147]

void to_null( mixed $v)



access:  public


[ Top ]

method to_string [line 130]

void to_string( mixed $v)

If string begins with [ and ends ], or begins with { and ends } it is assumed to be javascript arrays or objects and no further conversion is applied.



access:  public


[ Top ]


© 2004-2005 PRADO Software Group. All Rights Reserved.