Code Monkey home page Code Monkey logo

cfml-liquid's People

Contributors

rip747 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cfml-liquid's Issues

Incorrect naming of variables in LiquidLocalFileSystem.cfc

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#'")>

variable assign in if statement

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 }}

Accept Non-Simple Values in LiquidTagIf.cfc

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)>

elsif statement don't seems to work.

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 %}

causes errors

{{ 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.

convert to CF11 syntax

anonymous function could save me a TON of headaches and work arounds.
Time to update the library to CF11

if statement with multiple conditions

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 %}

Stack overflow when template includes itself

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.