Skip to content

Instantly share code, notes, and snippets.

@ndusan
Created April 5, 2012 07:27
Show Gist options
  • Save ndusan/2308754 to your computer and use it in GitHub Desktop.
Save ndusan/2308754 to your computer and use it in GitHub Desktop.
public function wraparoundAction()
{
$response = $this->getListingResponse('wraparound');
return $reponse;
}
public function dusanAction()
{
$response = $this->getListingResponse('dusan');
return $reponse;
}
public function getListingResponse($view)
{
$response = new Response();
$response->setPublic();
$response->setTtl(300);
$form = $this->get('core.form.newsletter');
$signedin = $this->get('request')->attributes->get('signedin');
$cookie = $this->get('request')->cookies->get('signedin', $signedin);
$response = $this->render(sprintf('Newsletter:%s.html.php', $view), array(
'form' => $form->createView(),
'isAjax' => $this->get('request')->isXmlHttpRequest(),
'alreadySignedIn' => $cookie,
), $response);
return $response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment