简体   繁体   English

播放Java Framework返回php文件进行查看

[英]Play Java Framework return php file to view

return ok(views.html.index.render(Group.all(), groupForm));

I need a way for the framework to use index.scala.php file instead of the default index.scala.html file. 我需要框架使用index.scala.php文件而不是默认index.scala.html文件的方法。 The code above renders the html file but is there a way to use the php file instead. 上面的代码呈现了html文件,但是有一种方法可以代替使用php文件。 I want the play framework to use php files instead of html. 我希望播放框架使用php文件而不是html。

I have absolutely no idea how this can be accomplished, but I imagine any hope of pulling off such a wild idea is to use the PHP/Java Bridge . 我完全不知道如何实现这一目标,但是我想拉出这种疯狂想法的任何希望都是使用PHP / Java Bridge You would have to rewrite the Play template rendering engine to generate HTML from PHP files. 您必须重写Play模板渲染引擎,才能从PHP文件生成HTML。

Good luck with that. 祝你好运。

I have built a simple bridge between CakePHP and Symfony 2 Controllers, so I can try to provide some general approach. 我在CakePHP和Symfony 2 Controllers之间建立了一个简单的桥梁,因此我可以尝试提供一些通用方法。 I can't provide specifics because I have never worked with Play personally, and you are bridging across different languages where I was not. 我无法提供具体信息,因为我从未亲自玩过Play,而且您正在跨语言学习,而我不是。

Definitely, take a look at the link @Vidya provided. 绝对可以看一下提供的@Vidya链接。 It might provide what you need already, but I've never worked with it personally. 它可能已经满足您的需求,但是我从来没有亲自使用过它。 Otherwise, I would avoid these alternatives and build your own. 否则,我将避免使用这些替代方法并自行构建。

I am sorry I don't have more details, but I hope this gives you an idea of what's involved. 抱歉,我没有更多细节,但是我希望这能使您对所涉及的事情有所了解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM