angelcharly/weather

1.0.3 2016-05-26 20:10 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:09:23 UTC


README

演示

示例外观

安装

通过 composer 安装。

{
  "require": {
    "angelcharly/weather": "~1"
  }
}

使用

  $html = \angelcharly\weather\Weather::getHtml();
  echo $html;

需要在网站根目录创建 .infra.json 文件

{
	"weather":{
		"city":"Tolyatti",
		"key": "там",
	}
}

openweathermap.org 网站上可以查看 city 和 key。

要求

需要 PHP 5.4 及以上版本。需要 composer,并已连接 vendor/autoload.php

测试

在浏览器中打开 /vendor/angelcharly/weather/tester.php