We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possible to render include tag from array? I don't want to load from a file
The text was updated successfully, but these errors were encountered:
There's a virtual filesystem in liquid/liquid in packagist. This is the package you will install with composer.
Used like this:
class MyFileSystem extends Liquid\FileSystem\Virtual { public static function fromArray($array) { return new static(function ($path) use ($array) { if (isset($array[$path])) { return $array[$path]; } return ''; }); } }
And then:
$template = new Template(); $template->setFileSystem(MyFileSystem::fromArray(array( 'example' => "Hello, {{ name }}!", ))); $template->parse("{% include 'example' %}"); echo $template->render(array("name" => "World"));
Sorry, something went wrong.
No branches or pull requests
possible to render include tag from array? I don't want to load from a file
The text was updated successfully, but these errors were encountered: