dynamikaweb/yii2-hgbrasil-weather

HGBrasil api, weather, previsao do tempo

v1.0.0 2021-06-09 20:09 UTC

This package is auto-updated.

Last update: 2024-04-10 02:33:03 UTC


README

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, 
    ]);