Does PHP Have an Equivalent of Java's RequestDispatcher.forward?

后端 未结 7 2120
南笙
南笙 2021-02-06 03:32

In Java I can write a really basic JSP index.jsp like so:

<% request.getRequestDispatcher(\"/home.action\").forward(request, response); %>

7条回答
  •  借酒劲吻你
    2021-02-06 04:16

    Try this.

    function forward($page, $vars = null){
        ob_clean();
        include($page);
        exit;
    }
    

    on included page the $vars variable will work as the java request attributes

提交回复
热议问题