在Play 2.0 Framework模板引擎中进行计算 [英] Calculation in Play 2.0 Framework template engine
本文介绍了在Play 2.0 Framework模板引擎中进行计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
play 2.0模板引擎是否支持html页面中的简单计算。
Does play 2.0 template engine support the simple calculation in the html page.
我们说,我创建了一个sum.scala.html页面:
Let us say, I create a sum.scala.html page:
@(a:String, b: String)
<html>
<head></head>
<body>
<h1> answer is getSum(@a,@b) </h1>
</body>
</html>
我们有什么方法可以通过某种功能获取a和b的aSum吗?或者有任何游戏2.0专家对游戏2.0模板引擎中的计算有什么好主意吗?谢谢
Is there any way that we could "getSum of a and b" via some function? or Does any play 2.0 expert know any good idea about calculation in play 2.0 template engine? Thanks
推荐答案
你试过 @(a.toInt + b.toInt)
?
这篇关于在Play 2.0 Framework模板引擎中进行计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文