Javascript in Prado, Questions and Answers
How do I include the predefined javascript libraries?
- Adding libraries in the template
<com:TClientScript UsingPradoScripts="effects" />
- Adding libraries in PHP code
$this->getPage()->getClientScript()->registerPradoScript("effects");
The available packaged libraries included in Prado are
- prado : basic prado javascript framework based on Prototype
- effects : visual effects from script.aculo.us
- ajax : ajax and callback related based on Prototype
- validator : validation
- logger : javascript logger and object browser
- datepicker : datepicker
- rico : Rico library
- colorpicker : colorpicker
The dependencies for each library are automatically resolved. Components
that require a particular library will also automatically load the necessary libraries.
For example, if you add a TDatePicker component on the page, the datapicker
and its dependencies will be automatically included on the page.