Skip to content

Latest commit

 

History

History
68 lines (51 loc) · 1.94 KB

README.md

File metadata and controls

68 lines (51 loc) · 1.94 KB

dynamikaweb/yii2-hgbrasil-weather

php version pkg version license quality build

Descripton

This Widget was based on the HG Weather API, to generate your access key and check the query parameters, see the API documentation

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require dynamikaweb/yii2-hgbrasil-weather "*"

or add

"dynamikaweb/yii2-hgbrasil-weather": "*"

to the require section of your composer.json file.


dynamika soluções web This project is under BSD-3-Clause license.

Usage

Add it to your components

'components' => [
    ...
    'weather' => [
        'class' => \dynamikaweb\weather\components\WeatherApi::className(),
        'key' => 'Your key, you can get it from HG Brasil',
        'parameters' => [
            'city_name' => 'Canoas,RS',
        ] 
    ],
    ...
]

for different parameters, see API documentation

create widget

    use dynamikaweb\weather\Weather;
    ...
    echo Weather::widget([
        'days' = 2,
        'icons' = Weather::ICONS_DEFAULT, 
    ]);