Weather Forecast widget class
Options:
provider (string):
Name of the weather forecast provider. Can be specified with or without "Weather" at the end: e.g. BBC and BBWeather will both use the BBCWeather provider
params (array):
Contains provider dependant parameters; see the documentation for the provider classes.
While the exact requiremets are provider dependant, there are three common parameters:
dateFormat (string) => Date format for days; Used by CDateFormatter::format(), see Date Format Patterns for a description of formats. Default: "EEE d' 'MMM yyyy"
location (string) => location of the forecast in the providers format. Default location is London, UK
units (string) => Units to provide the forecast in. "C"|"F" C=metric (default), F=imperial
cache (mixed):
integer: number of seconds before the forecast expires</br> array:
0 (integer) => number of seconds before the forecast expires
1 (CCacheDependency) => Cache dependency object
boolean false: Disable cacheing. i.e. every access creates a request to the provider.
null (default): Cache the forecast for one hour
cssFile (mixed):
string: Path to the CSS file to use
boolean false: No CSS file
null (default): Use the default CSS file
symbolsDir (mixed):
string: Path to the directory containing symbols to use
boolen false: Use the providers symbols specified in the data (Google only)
null (default): Use the default symbols
symbolMap (mixed):
array: Associative array that maps a forecast parameter (e.g., description, code, etc.) to the symbol to use for a given value of the parameter. e.g. 'symbolMap' => array( 'Partly Cloudy' => partly_cloudy.gif, 'Sunny' => 'sunn.gif', etc. );
null (default): Use the provider's default symbol map
Example Useage
Located in /WeatherForecast.php (line 99)
CWidget | --WeatherForecast
Factory method to load the forecast provider
Initialises the widget
Registers the CSS file and sets the required forecast provider, loading it if required
Renders the forecast table
Display the forecast
The cached forecast is used if enabled and not expired
Documentation generated on Tue, 13 Oct 2009 14:44:47 +0100 by phpDocumentor 1.4.2