nyeholt / silverstripe-weatherforecast
Retrieve a weather forecast (uses openweather)
Installs: 4 160
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 3
Open Issues: 0
Language:HTML
Type:silverstripe-module
Requires
- silverstripe/framework: ~3.1
This package is auto-updated.
Last update: 2024-10-29 04:25:35 UTC
README
Usage
In your project .yml config
---
Name: weather-config
After: weatherforecast/*
---
Injector:
OpenWeatherService:
properties:
key: {your key here}
From your code, call the following. The LocationID will need to be looked up from the openweather site.
Requirements::css('weatherforecast/owfonts/css/owfont-regular.min.css');
$forecast = singleton('OpenWeatherService')->forecastFor($locationID);
PLEASE NOTE
The requirements of OpenWeatherMaps mean you must provide attribution on your site for using the service.