nyeholt / silverstripe-weatherforecast
Retrieve a weather forecast (uses openweather)
Package info
github.com/nyeholt/silverstripe-weatherforecast
Language:HTML
Type:silverstripe-module
pkg:composer/nyeholt/silverstripe-weatherforecast
dev-master / 1.0.x-dev
2016-07-20 07:19 UTC
Requires
- silverstripe/framework: ~3.1
This package is auto-updated.
Last update: 2026-03-01 00:22:05 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.