Download the PHP package dwr/openweather-bundle without Composer
On this page you can find all versions of the php package dwr/openweather-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dwr/openweather-bundle
More information about dwr/openweather-bundle
Files in dwr/openweather-bundle
Package openweather-bundle
Short Description Symfony3 bundle wraps Open Weather API.
License MIT
Homepage https://github.com/dariuszwrzesien/DwrOpenWeatherBundle
Informations about the package openweather-bundle
DwrOpenWeatherBundle
DwrOpenWeatherBundle is a simply wrapper bundle for Open Weather API.
In order to start please generate your personal ApiKey first.
You can do it here.
Installation
When you have ApiKey, installation is a quick 3 steps process:
- Download DwrOpenWeatherBundle using composer
- Enable the Bundle
- Add routing to routing.yml in order to can open example in your browser
Step 1: Download DwrOpenWeatherBundle using composer
Add DwrOpenWeatherBundle in version 2.0 to your composer.json and run 'composer update'
or download the bundle by running the command:
Composer will install the bundle into your project's vendor/dwr/openweather-bundle
directory.
Step 2: Enable the bundle and add APIKEY to config.yml
Enable the bundle in the kernel:
Add APIKEY to your config.yml
Step 3: Add routing to routing.yml in order to can open example in your browser
Congratulations! You're ready to show weather widget in your symfony application.
Example how weather-basic-small looks like you can find on: yours-application-url/weather-basic-small .
Usage
GET Weather
In your Controller
You can get weather from OpenWeather API by using:
- getByCityName('London')
- getByCityId('2643743')
List of city ID city.list.json.gz can be downloaded here - getByGeographicCoordinates(-0.12574, 51.50853)
GET Forecast
In your Controller
You can get forecast from OpenWeather API by using:
- getByCityName('London')
- getByCityId('2643743')
List of city ID city.list.json.gz can be downloaded here - getByGeographicCoordinates(-0.12574, 51.50853)
Examples
Take a moment and check examples. Maybe you will find there a solution which you like.
In order to run examples on your local:
- Add route in your routing.yml (app/config/routing.yml).
- After that, examples should be available in following url addresses:
- yours-application-url/weather-basic-small
- yours-application-url/weather-basic-medium
- yours-application-url/weather-basic-large
- yours-application-url/forecast-chart
- yours-application-url/forecast-basic
How does it exactly look like, you may see below.
weather-basic-small
Example from: Dwr\OpenWeatherBundle\Controller\DefaultController.php
Action: weatherBasicSmallAction()
weather-basic-medium
Example from: Dwr\OpenWeatherBundle\Controller\DefaultController.php
Action: weatherBasicMediumAction()
weather-basic-large
Example from: Dwr\OpenWeatherBundle\Controller\DefaultController.php
Action: weatherBasicLargeAction()
forecast-chart
Example from: Dwr\OpenWeatherBundle\Controller\DefaultController.php
Action: forecastChartAction()
forecast-basic
Example from: Dwr\OpenWeatherBundle\Controller\DefaultController.php
Action: forecastBasicAction()
Change log
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of openweather-bundle with dependencies
symfony/framework-bundle Version 3.*
symfony/twig-bundle Version 3.*
guzzlehttp/guzzle Version ~6.0