如何安装玩!框架模块?
我正在尝试为我的 Play 安装此分页模块!应用程序,但无法使其工作。我已经在 /play/modules/paginate-head/ 中提取了 zip 文件,并且我在这里举了一个示例,将我的 dependency.yml 文件更改为:
# Application dependencies
require:
- play
- pagination -> paginate-head
repositories:
- My modules:
type: local
artifact: ${application.path}/../[module]
contains:
- paginate-head
但我仍然不认为该模块正在加载。我假设它的文档应该出现在 http://localhost:9000/@documentation/home
上,或者是否有其他方法来查看模块是否已加载?它也没有在控制台中告诉我任何信息。
有什么想法如何安装这个吗?
I'm trying to install this pagination module for my Play! application, but can't get it to work. I've extracted the zip file inside /play/modules/paginate-head/ and I an example here on SO, to change my dependencies.yml file into:
# Application dependencies
require:
- play
- pagination -> paginate-head
repositories:
- My modules:
type: local
artifact: ${application.path}/../[module]
contains:
- paginate-head
But I still don't think the module is being loaded. I'm assuming it's documentation should appear on http://localhost:9000/@documentation/home
or are there other ways to see if a module was loaded? It's not telling me anything in the console neither.
Any ideas how to get this installed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要解压 zip 文件,只需运行命令
应该可以正常工作。但解压也可以。您也不需要 dependency.yml 文件中的“存储库”部分。玩!知道在哪里可以找到模块。
真正的问题是您的要求应该如下所示:
注意“->”左侧的播放这表明它是一个模块。 “分页”和“头部”之间也没有破折号。这是因为“paginate”是模块名称,“head”是版本,它们应该用空格分隔。
此外,对于主 Play 中托管的模块!模块存储库,您甚至不必安装它们。您只需添加上面的要求即可开始播放!它会自动安装。虽然它将安装在应用程序模块目录下,而不是播放模块目录下。
希望有帮助!
You don't need to extract a zip file, just running the command
should work fine. But unzipping will also work. You also don't need that "repositories" section in your dependencies.yml file. Play! knows where to find modules.
The real issue is that your require should look like this:
Notice play to the left of the '->' which signifies that it's a module. Also no dash between 'paginate' and 'head'. That's because 'paginate' is the module name and 'head' is the version and these should be separated by a space.
Also, for modules that are hosted in the main Play! modules repo, you don't even have to install them. You can just add the require above and start Play! and it will install it automatically. Though it will install under the applications modules directory, not the play modules directory.
Hope that helps!