newscoop / meteoblue-plugin-bundle
为Newscoop设计的Meteoblue插件包
dev-master
2014-04-14 13:08 UTC
Requires
- php: >=5.3.3
- guzzle/guzzle: dev-master
- newscoop/plugins-installer: *
This package is not auto-updated.
Last update: 2024-09-24 02:26:54 UTC
README
NewscoopMeteobluePluginBundle
安装/更新/移除
概述
所有安装/更新/移除功能都由Newscoop插件管理器处理。
安装
一旦安装,请安排在crontab计划中运行每天更新头部温度值(存储在数据库中)的天气:更新作业。要手动运行作业,请运行以下命令
php application/console weather:update
模板示例
{{ meteoblue_header }}
将上述代码放置在模板中以实现将天气统计数据头放入您的模板
{{ assign var="ch_city" value=$smarty.get.city }}
{{ if empty($ch_city) }}{{ $ch_city = 'Basel' }}{{ /if }}
{{ if $ch_city == "Basel" }}{{ assign var="citycode" value="basel_ch_376" }}{{ /if }}
{{ if $ch_city == "Liestal" }}{{ assign var="citycode" value="liestal_ch_2612" }}{{ /if }}
{{ if $ch_city == "Gempen" }}{{ assign var="citycode" value="gempen_ch_1587" }}{{ /if }}
{{ if $ch_city == "Passwang" }}{{ assign var="citycode" value="passwang_ch_3469" }}{{ /if }}
{{ if $ch_city == "Zurich" }}{{ assign var="citycode" value="zurich_ch_5254" }}{{ /if }}
{{ if $ch_city == "Bern" }}{{ assign var="citycode" value="bern_ch_449" }}{{ /if }}
{{ if $ch_city == "Genf" }}{{ assign var="citycode" value="genf_ch_1605" }}{{ /if }}
{{ if $ch_city == "Lugano" }}{{ assign var="citycode" value="lugano_ch_2680" }}{{ /if }}
<div class="content-box clearfix">
<section>
{{ meteoblue_details citycode=$citycode height=1900 width=650 }}
</section>
</div>
上述代码可用于创建一个详情页面,该页面接受城市名称作为参数并显示meteoblue天气详情iframe。有关可用城市代码的更多详细信息,请参阅meteoblue.com。