Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

twig render to variable

// Instead of
$view->render($response, 'template.twig', []);
// Use
$content = $view->fetch('template.twig', []);
// It will not be added to a response, 
// just saved as a string in the variable!
 
PREVIOUS NEXT
Tagged: #twig #render #variable
ADD COMMENT
Topic
Name
4+6 =