I came across at this thread, does anybody know how to do this in Play! 1.2.4? Thanks.
问问题
110 次
2 回答
0
更好的是,创建一个扩展 Controller 的超级控制器。之后,让你所有的控制器扩展你的 SuperController。
class SuperController extends Controller {
@Before
public static function before() {
// Set global variables using renderArgs
}
}
class MyController extends SuperController {
public function myMethod() {
// Do whatever your method does.
}
}
查看文档:http ://www.playframework.org/documentation/1.2.4/controllers#result
于 2012-04-21T14:08:32.810 回答