mabn17 / weather
anax框架的天气模块。
Requires
- php: >=7.2
- anax/commons: ^2.0.0@beta
Requires (Dev)
- anax/anax-lite: ^1.0.24
- anax/page: ^2.0.0@alpha
- anax/view: ^2.0.0@alpha
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-07-27 08:59:14 UTC
README
Anax天气模块,实现天气应用。
此天气模块可用于查看本周天气和/或过去一个月的天气。与Anax安装一起使用。
此模块具有图形界面,用户可以搜索特定位置,并接收本周天气和过去30天的数据。
它还提供了一个带有GET方法的REST API。路由参数为位置,返回一个包含与图形界面相同和更多详细信息的JSON响应。更多信息请见 View/explainJson.php。
安装和配置Anax
首先安装自己的Anax版本。
将天气应用作为Anax的一部分安装
使用composer安装,然后集成模块到您的Anax安装中。
使用composer安装
我们将天气应用作为Packagist中的模块进行安装。
composer require mabn17/weather
天气配置文件
我们需要复制天气模块的配置文件。
rsync -av vendor/mabn17/weather/config/keys.php config/
注意:请记得将值更改为您自己的DarkSky API密钥。
视图 & 文档
我们需要复制API文档和天气模块视图。
rsync -av vendor/mabn17/weather/view/weather view/anax/v2/
如果您想将文档改为markdown格式,请在新文件中创建一个新文件在anax/content/
。路由名称将与您的.md文件名称相同。
控制器和模型
将vendor/mabn17/weather/src/Controller/
中的文件移动到src/Controller/
,然后修改两个控制器类中的$page->add(/view/weather/name)
到注释行。
将vendor/mabn17/weather/src/Weather
文件夹移动到src/
文件夹。
rsync -av vendor/mabn17/weather/src/Controller/ src/Controller/
rsync -av vendor/mabn17/weather/src/Weather src/
路由文件
您需要在路由配置anax/config/router/
中包含路由文件。您可以在vendor/mabn17/config/router/902_vader.php
中使用示例。
rsync -av vendor/mabn17/anax/weather/config/router/902_vader.php config/router/
DI服务
您需要添加di的配置文件。
您需要添加di服务的配置anax/config/di/
。您可以在vendor/mabn17config/di/weather.php
中使用示例。
rsync -av vendor/mabn17/weather/config/di/weather.php config/di/
许可证
.
..: Copyright (c) 2018 - 2019 Martin Borg (martin.d@live.se)