A weather module for the anax framework.
Anax weather module implementing a weather application.
This Weather module can be used to see the weeks weather and/or the weather for the past month. Use this together with an Anax installation.
This module has a graphical part in witch the user searches for a given location and resives the data of the weeks weather and the past 30 days.
It also provides a REST api with HTTP method GET. The route takes a location as an argument and returns a JSON response with the same and more details as the graphical interface. See more in View/explainJson.php.
First install your own version of Anax.
Install using composer and then integrate the module with your Anax installation.
We install the Weather app as a module from Packagist.
composer require mabn17/weather
We need to copy the configuration files for the weather module.
rsync -av vendor/mabn17/weather/config/keys.php config/
Note: Remember to change the value to your own DarkSky API key.
We need to copy the API documentation and the weather module views.
rsync -av vendor/mabn17/weather/view/weather view/anax/v2/
If you would like to change the documentation to markdown then create a new file in
anax/content/. The route will have the same name as your .md file has.
Move the files in
src/Controller/ then change
$page->add(/view/weather/name) to the commented line in both controller classes.
vendor/mabn17/weather/src/Weather folder into the
rsync -av vendor/mabn17/weather/src/Controller/ src/Controller/ rsync -av vendor/mabn17/weather/src/Weather src/
You need to include the router file in your router configuration
anax/config/router/. There is a sample you can use in
rsync -av vendor/mabn17/anax/weather/config/router/902_vader.php config/router/
You need to add the configuration file for di.
You need to add the configuration for the di services
anax/config/di/. There is a sample you can use in
rsync -av vendor/mabn17/weather/config/di/weather.php config/di/
. ..: Copyright (c) 2018 - 2019 Martin Borg (email@example.com)