read weather from external source api
This widget has 3 nodes of data.
- Currently
- Hourly
- Daily
How to use it.
Just add below lines in your composer.json file
"paskuale75/yii2-weather-forcast-widget" : "dev-master"
Open your terminal and run command composer install
or
composer require rahulswt7/yii2-weather-widget
After installation
Initially Currently weather
data will show.
<?php
echo paskuale75\weather\WeatherForcast::widget();
?>
<?php
echo paskuale75\weather\WeatherForcast::widget([
'currently' => false,
'hourly' => true
]);
?>
<?php
echo paskuale75\weather\WeatherForcast::widget([
'currently' => false,
'hourly' => false,
'daily' => true
]);
?>