Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController::exportAction PHP Method

exportAction() public method

Exports data for a given token.
public exportAction ( string $token ) : Response
$token string The profiler token
return Symfony\Component\HttpFoundation\Response A Response instance
    public function exportAction($token)
    {
        $profiler = $this->container->get('profiler');
        $profiler->disable();

        if (!$profile = $profiler->loadProfile($token)) {
            throw new NotFoundHttpException(sprintf('Token "%s" does not exist.', $token));
        }

        return new Response($profiler->export($profile), 200, array(
            'Content-Type'        => 'text/plain',
            'Content-Disposition' => 'attachment; filename= '.$token.'.txt',
        ));
    }