Comments (1)
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"));
from php-liquid.
Related Issues (20)
- Error when extending tag HOT 1
- error_mode HOT 3
- Possible to get list of assigned variables from parsed template in PHP?
- How to register an Extended AbstractTag? HOT 1
- Error in assign with objects
- Comparison Error in src/Liquid/LocalFileSystem.php HOT 1
- 500 error in response in codeigniter. HOT 1
- Environment & server variables are available in all templates HOT 6
- Where is LiquidBlock class location
- White space control as default
- How to test if variable is a number?
- Create object to use in themes
- Disable Casesensitive
- PHP version incompatible? HOT 1
- Colon not allowed in date format string? HOT 1
- Install mode
- Update to the latest version HOT 1
- Unknown tag render
- Maintenance the project HOT 2
- I'd like to use the snippets and templates such as shopify themes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-liquid.