rip747 / cfml-liquid Goto Github PK
View Code? Open in Web Editor NEWa port of the liquid templating language to coldfusion
License: MIT License
a port of the liquid templating language to coldfusion
License: MIT License
Great work on cfml-liquid, you've done a fantastic job!
I've found a couple of issues in LiquidLocalFileSystem.cfc where certain variables are being accessed with the wrong names:
In method read_template_file the following lines
<cfset loc.full_path = this.full_path(arguments.templatePath)>
<cffile action="read" file="#loc.fullpath#" variable="loc.contents">
Should be replaced with
<cfset loc.full_path = this.full_path(arguments.template_path)>
<cffile action="read" file="#loc.full_path#" variable="loc.contents">
Also within the full_path method:
<cfset createObject("component", "LiquidException").init("Illegal template name 'arguments.template_path'")>
Should have the template name as a CFML variable, like
<cfset createObject("component", "LiquidException").init("Illegal template name '#arguments.template_path#'")>
implement some sort of caching
RocketUnit is dead ๐ญ
Time to move on and up to TextBox
https://github.com/Shopify/liquid/wiki/Liquid-for-Designers
try to get the filters and tags on par with the ruby version
If there are multiple conditions on an if statement (and/or), only the first one gets evaluated. I've looked at the source and can see that there is a variable called loc.tt that holds the subsequent condition (LiquidTagIf.cfc, line 114). However, this variable doesn't get used anywhere and I can't see a simple way of including that variable in the process.
{% assign test1 = 'maybe' %}
{% if test1 != 'no' and test1 != 'maybe' %}
yes
{% endif %}
need some test coverage for when invalid arguments are passed to filters.
Seems that the unless tag is missing from the library. It's basically the same as an "if" tag, but a negation of the value.
make sure that you can use queries
For recursively included templates, the LiquidTagInclude
will consume all memory due to the parse
method's call to tokenize
. Possibly perform this action within the render
function?
Not sure if it's to the Liquid-spec, but the following line in LiquidTagIf.cfc could be extended to provide complex-values as boolean matches:
<cfif (IsBoolean(loc.display) and loc.display) OR (!IsBoolean(loc.display) AND len(loc.display) AND loc.display neq "null")>
Which would allow the usage of arrays, structures, and other objects within the {% if ... %} statements. Here is an example of what it could be modified to:
<cfif (IsBoolean(loc.display) and loc.display)
OR (IsSimpleValue(loc.display) AND NOT IsBoolean(loc.display) AND Len(loc.display) AND loc.display neq "null")
OR (IsArray(loc.display) AND ArrayLen(loc.display))
OR (IsStruct(loc.display) AND StructCount(loc.display))
OR (IsQuery(loc.display) AND loc.display.recordCount)>
anonymous function could save me a TON of headaches and work arounds.
Time to update the library to CF11
Need to write all the test first and then get everything else working.
EXTREMELY important that 2.0 be backwards compatible with 1.2
Really great work on cfml-liquid. I really appreciate it.
I've just tried an elsif statement but it doesn't seem to work.
I can see that in LiquidTagIf.cfc you cater for elsif, but I'm not sure what happens after that.
There aren't any test cases in the test folder so perhaps this is something that hasn't been completed yet.
Before I start familiarising myself with the code and breaking things, I thought I would contact you to see if you may know why it isn't working.
{% assign test = "hello" %} {% if test == 'bye' %}Bye
{% elsif test == 'hello' %}Hello
{% else %}Rude
{% endif %}{{ menu id:"#attributes.Id#" }}
this is causing the following error to happen:
The method toString was not found in component
Seems that the tokenizer doesn't like the space between menu and id.
If a variable is assigned within an if statement, the value of that assign is not kept outside of that block.
{% assign test1 = 'maybe' %}
{% if test1 == 'maybe' %}
{% assign test1 = 'yes' %}
{% endif %}
{{ test1 }}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.