Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

twig render to string

// 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!
Source by techpunch.co.uk #
 
PREVIOUS NEXT
Tagged: #twig #render #string
ADD COMMENT
Topic
Name
9+9 =