dynamikaweb / yii2-hgbrasil-weather
HGBrasil api, weather, previsao do tempo
Installs: 59
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Type:yii2-extension
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, ]);