Overview

Classes

  • weather
  • Overview
  • Class
  • Tree

Class weather

Weather widget class All Documentation included in this document. For further developer note please see the Weather.php class

Author: Samy Massoud <samymassoud@gmail.com>
Version: 1.0.1
Link: http://www.deploy2cloud.com/demo/weather
Tutorial: This class main functionality is to provide weather wedget to use it easily and smoothly. You can use this class with almost zero configuration , or configure it as far as you need ! When i started to write this class i put in mind to make it easy,clean and professional as much as i can. To start using this class just do the following 1- include attached weather.css file in your page. 2- Make sure that you have embedded jquery version greater than 1.6 3- Include this class in your page and Make object from this class with required city $weather = new weather ("Cairo,EG"); echo $weather->get_weather (); And you will get a copy from this widget with cairo weather ! To start using this class as codeigniter library 1- include attached weather.css file in your page. 2- Make sure that you have embedded jquery version greater than 1.6 3- Move weather.php to application/libraries folder and you can load library by adding it to autoload.php or use $this->load->library ('weather'); and at any place in your application (Controller or view) $this->weather->set_city ('Cairo,EG'); echo $this->weather->get_weather (); And you will get a copy from this widget with cairo weather !
Located at weather/weathercore.php
Methods summary
public
# __construct( type $config = null )

Construct weather widget you can provide any configration you want Click right # to see more

Construct weather widget you can provide any configration you want Click right # to see more

Parameters

$config
type
array

Example

$config = array ('theme' => 'blue', 'city' => 'cairo,eg', 'temp_metrics' => 'f'); $weather = new weather ($config);
public
# set_city( type $name = null, type $id = null, type $lat = null, type $lon = null )

set city by it's name or id or lat. and lon.

set city by it's name or id or lat. and lon.

Parameters

$name
type
string
$id
type
integer
$lat
type
decimal
$lon
type
decimal
public
# set_theme( type $theme )

Set Theme

Set Theme

Parameters

$theme
type
string
public
# set_temp_metrics( type $metrics = 'c' )

Set temp. metrics

Set temp. metrics

Parameters

$metrics
type
char
public
# set_lang( type $lang )

Set language

Set language

Parameters

$lang
type
string
public
# set_dimention( type $width, type $height )

Set widget dimention

Set widget dimention

Parameters

$width
type
integer
$height
type
integer
public
# set_output( type $out = "" )

Set output type accept empty string or word 'row'

Set output type accept empty string or word 'row'

Parameters

$out
type
string
public
# set_cache( type $cache_time, type $cache_folder = false )

set cache time and folder and this will enable cache you have to provide cache time greater than 0 second and cache folder name is optional , if you didn't provide it it will use default cache folder

set cache time and folder and this will enable cache you have to provide cache time greater than 0 second and cache folder name is optional , if you didn't provide it it will use default cache folder

Parameters

$cache_time
type
integer
$cache_folder
type
string
public
# disable_cache( )

Stop caching

Stop caching

public type
# get_weather( )

get weather widget or row array according to your config $this->weather_info['rain'] array is available if any rain data available AND it's array:) Thank's for Ray <ray@tzweather.org>

get weather widget or row array according to your config $this->weather_info['rain'] array is available if any rain data available AND it's array:) Thank's for Ray <ray@tzweather.org>

Returns

type
weather_class API documentation generated by ApiGen 2.8.0