From b52440acc275d7e486334d939be828998c3b6833 Mon Sep 17 00:00:00 2001 From: Moritz Kornher Date: Tue, 23 Jun 2015 11:10:17 +1200 Subject: [PATCH] Include the pjax container element in the response --- src/JacobBennett/Pjax/PjaxMiddleware.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JacobBennett/Pjax/PjaxMiddleware.php b/src/JacobBennett/Pjax/PjaxMiddleware.php index 6501c43..5d49563 100644 --- a/src/JacobBennett/Pjax/PjaxMiddleware.php +++ b/src/JacobBennett/Pjax/PjaxMiddleware.php @@ -42,7 +42,7 @@ public function handle($request, Closure $next) } // Set new content for the response - $response->setContent($title . $response_container->html()); + $response->setContent($title . $response_container->getNode(0)->ownerDocument->saveHTML($response_container->getNode(0))); } // Updating address bar with the last URL in case there were redirects