/** * Prepare the PJAX-specific response content. * * @param Response $response * @param string $container * * @return $this */ protected function filterResponse(Response $response, $container) { if (!$response->isSuccessful()) { $crawler = new Crawler($response->getContent()); $response->setContent($this->fetchContents($crawler, '.exception_message')); return $this; } $crawler = new Crawler($response->getContent()); $response->setContent($this->makeTitle($crawler) . $this->fetchContents($crawler, $container)); return $this; }