dynamikaweb / yii2-hgbrasil-weather
HGBrasil api, weather, previsao do tempo
Package info
github.com/dynamikaweb/yii2-hgbrasil-weather
Type:yii2-extension
pkg:composer/dynamikaweb/yii2-hgbrasil-weather
v1.0.0
2021-06-09 20:09 UTC
Requires
- php: >=7.4.0
- yiisoft/yii2: *
README
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.
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, ]);