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

Class: TClientScript

Source Location: /Web/UI/TClientScript.php

Class Overview


PradoClientScript class.

Class Details

[line 41]
PradoClientScript class.

PradoClientScript::register($control, $scripts) registers the required client-side javascript files to the page. Prado provides the following basic javascript libraries, e.g.$this->registerClientScript('dom')

  • base basic javascript utilities, e.g. $()
  • dom DOM and Form functions, e.g. $F(inputID) to retrive form input values.
  • effects Effects such as fade, shake, move
  • controls Prado client-side components, e.g. Slider, AJAX components
  • validator Prado client-side validators.
  • ajax Prado AJAX library including Prototype's AJAX and JSON.
Dependencies for each library are automatically resolved.

Namespace: System.Web.UI




version:  $Revision: 1.1 $ $Date: 2005/11/06 23:02:33 $
author:  Wei Zhuo<weizhuo[at]gmail[dot]com>


[ Top ]

Variables

Methods



Class Variables

$dependencies = array(
      'base' => array('base'),'dom'=>array('base','dom'),'effects'=>array('base','dom','effects'),'controls'=>array('base','dom','effects','controls'),'validator'=>array('base','dom','validator'),'logger'=>array('base','dom','logger'),'ajax'=>array('base','dom','ajax'))

[line 47]

Client-side javascript library dependencies



static:  
access:  protected

Type:   array


[ Top ]

$services = array(
      'ajax' => 'AJAX' //service name
      )

[line 61]

Client service URI.



static:  
access:  protected

Type:   array


[ Top ]



Class Methods


method getDependencies [line 96]

array getDependencies( array $scripts)

Resolve dependencies for the given library.



return:  list of libraries including its dependencies.
static:  
access:  protected


Parameters:

array   $scripts   list of libraries to load.

[ Top ]

method getServiceUri [line 116]

string getServiceUri( TControl $control, string $service)

Get service URI.



return:  service URI.
static:  
access:  protected


Parameters:

TControl   $control   service control.
string   $service   service name.

[ Top ]

method register [line 75]

void register( TControl $control, string $scripts)

Register client-side libraries for adding to the page.

The parameter $scripts can be an array, or a string. E.g. PradoClientScript::register($this, array('dom', 'mycontrols')); to register the DOM library and its dependencies, and to register a custom javascript file 'mycontrols.js' (which must be web accessiable in the /js/ directoy.




static:  
access:  public


Parameters:

TControl   $control   the control for registering the scripts
string   $scripts   the library to register.

[ Top ]


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