我想使用 Bootstraps glyphicons游戏框架
所以当我使用 <i class="icon-search" />
, Bootstrap 正在“assets/img/...”中寻找图标。此行为与 anatomy of a play application 冲突。因为图像在“assets/images/...”中。
所以我试图通过为“assets/img”的 GET 请求定义一个额外的路由来重新映射它:
# Map static resources from the /public folder to the /assets URL path
GET /assets/img/*file controllers.Assets.at(path="/public/images", file)
GET /assets/*file controllers.Assets.at(path="/public", file)
但是这样做,我得到一个编译错误“没有足够的方法参数:(路径:字符串,文件:字符串)play.api.mvc.Call。未指定的值参数文件。”在我调用的所有其他公共(public) Assets 上。
我究竟做错了什么?
最佳答案
实际上描述我的问题帮助我在这里搜索它;) ...stackoverflow 已经有了答案。希望我的问题至少与我自己回答的这个问题有更多的相关性。
根据How to use Twitter Bootstrap 2 with play framework 2.x我必须为每个单独的 glyphicons 文件定义静态路由,然后对其他 Assets 的请求不会被“错误路由”。
我只是添加了
# Map Bootstrap images
GET /assets/img/glyphicons-halflings.png controllers.Assets.at(path="/public", file="/images/glyphicons-halflings.png")
GET /assets/img/glyphicons-halflings-white.png controllers.Assets.at(path="/public", file="/images/glyphicons-halflings-white.png")
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
到我的路线,所以我不需要以特殊方式修改任何框架。
无论如何感谢您的建议
关于twitter-bootstrap - 游戏框架中的 Bootstrap 字形图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15344727/