Aimeos\ShopBundle\Controller\AbstractController::getOutput PHP Method

getOutput() protected method

Returns the output of the client and adds the header.
protected getOutput ( string $clientName ) : Response
$clientName string Html client name
return Symfony\Component\HttpFoundation\Response Response object containing the generated output
    protected function getOutput($clientName)
    {
        $tmplPaths = $this->container->get('aimeos')->get()->getCustomPaths('client/html/templates');
        $context = $this->container->get('aimeos_context')->get();
        $langid = $context->getLocale()->getLanguageId();
        $view = $this->container->get('aimeos_view')->create($context, $tmplPaths, $langid);
        $context->setView($view);
        $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName);
        $client->setView($view);
        $client->process();
        $twig = $this->container->get('twig');
        $vars = $twig->getGlobals();
        if (!isset($vars['aiheader'])) {
            $vars['aiheader'] = array();
        }
        $vars['aiheader'][$clientName] = (string) $client->getHeader();
        $twig->addGlobal('aiheader', $vars['aiheader']);
        return new Response((string) $client->getBody());
    }
AbstractController