Play! Framework 学习笔记 — 安装Module模块

涉及的版本:Play! Framework 1.2.4。

本文介绍如何往Play!框架中添加新的module。

1、获取module列表;
可以通过命令行的方式:
play list-modules

或者直接访问网站:
[url]http://www.playframework.org/modules[/url]

2、安装模块;
在命令行中输入:
play install [module_name]

比如安装Redis的module,可以输入:
play install redis
接着会提问是否安装最新的版本:

~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! 1.2.4, http://www.playframework.org
~
~
~ !! Warning: could not load core command fil
~
~ Will install redis-0.3
~ This module is compatible with:
~ Do you want to install this version (y/n)?


输入y,回车继续。

以下是安装成功后的信息:

~ Installing module redis-0.3...
~
~ Fetching http://www.playframework.org/modules/redis-0.3.zip
~ [--------------------------100%-------------------------] 12.2 KiB/s
~ Unzipping...
~
~ Module redis-0.3 is installed!
~ You can now use it by adding it to the dependencies.yml file:
~
~ require:
~ play -> redis 0.3
~


3、模块的使用;
一般每个模块都会带有使用文档,存放于[Play目录]\modules\[模块名称]\documentation下面,比如上面安装的redis模块的使用文档放于:play\modules\redis-0.3\documentation\manual。

在conf/dependencies.yml文件中添加play -> redis 0.3:

# Application dependencies

require:
- play
- play -> redis 0.3
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值