$f3->route('GET /template-from-string', function($f3){
$f3->set('userName', 'John');
$body = '<p>This is for {{ @userName }}</p><p>The end</p>';
/** @var FAL $fal */
$fal = FAL::instance();
$fal->load('template.html');
$fal->setContent($body);
$fileStream = $fal->getFileStream(); // fal://template.html
// file_exists($fileStream); is now TRUE
// workaround templates "file must be in UI dir" limitation
$f3->set('UI',$f3->get('UI').'| ');
// render file
echo \Template::instance()->render($fileStream);
});
$content = $template->resolve( $template->parse( $template ) );--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To post to this group, send email to f3-fra...@googlegroups.com.
Visit this group at https://groups.google.com/group/f3-framework.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/ac7be4bf-4346-4560-861b-9b4d6cd9eb45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.