PHP code example of dynamikaweb / yii2-hgbrasil-weather

1. Go to this page and download the library: Download dynamikaweb/yii2-hgbrasil-weather library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dynamikaweb / yii2-hgbrasil-weather example snippets


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

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