Download the PHP package saviorlv/yii2-weather without Composer
On this page you can find all versions of the php package saviorlv/yii2-weather. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package yii2-weather
yii2-weather 基于高德开放平台的天气信息组件。
安装
配置
在使用本扩展之前,你需要去 高德开放平台 注册账号,然后创建应用,获取应用的 API Key。
使用
在config/main.php配置文件中定义component配置信息
获取实时天气
示例:
获取近期天气预报
示例:
获取 XML 格式返回值
以上两个方法第二个参数为返回值类型,可选
json
与xml
,默认json
:
示例:
参数说明
$city
- 城市名/高德地址位置 adcode,比如:“深圳” 或者(adcode:440300);$format
- 输出的数据格式,默认为 json 格式,当 output 设置为 “xml
” 时,输出的为 XML 格式的数据。
参考
感谢
非常感谢 overtrue/weather
License
MIT
All versions of yii2-weather with dependencies
PHP Build Version
Package Version
The package saviorlv/yii2-weather contains the following files
Loading the files please wait ....