Comments (4)
- Now the priority of tags parsing in lightncandy is compileSection -> compileCustomHelper -> compileVariable . (check the code from line 1232 ~ line 1246) , so these are true now:
- You can not overwrite build-in helpers by custom helpers, ex: {{#each }}
- When you use duplicate names on both custom helper and variable , custom helper will be used.
- The priority of tags parsing can be changed if we think another way is better.
- I think lightncandy should align with handlebars.js behavior. So, I need to write some tests on handlebars.js, then decide the correct order by the testing results.
from lightncandy.
Yes, it does make sense. Behavior should be aligned with handlebars.js, completely agree.
Variables can be accessed using @root.variable
, so I think it can be left as-is, now that I think of it.
from lightncandy.
Based on this test : http://jsfiddle.net/TY8cJ/1/
custom helper > default helper > variable
This behavior will be applied to lightncandy later.
from lightncandy.
After I review the code of lightncandy deeply , the current order is
compileBlockCustomHelper > compileBlockBegin > compileCustomHelper > compileVariable
So the behavior already same with handlebars.js . No more fix required, and close this. Thanks.
from lightncandy.
Related Issues (20)
- Tests still pass even if phpunit fails HOT 1
- Size in README.md out of date HOT 5
- Render-time partials cannot access @partial-block.
- Class instance method as helper function
- Array value passed to helper as null within #each HOT 2
- Raw block working until the end of template
- Possible to access parsed variables?
- Valid use for Lightncandy::prepare() HOT 6
- Nested Helpers Unavailable When Rendered
- The problem in PHP8 HOT 7
- Bad indentation in case of nested partials
- Different behaviour than Javascript when modifying context in helper HOT 1
- Hi...broken forum link
- Opencart 1.5.6 Integration
- SafeString fails with FLAG_EXTHELPER | FLAG_BESTPERFORMANCE
- Custom condition helper over payload array with conditions
- Subexpression with a string where zero spaces occur before parenthesis breaks Parser
- Custom Block Helper with blockParams
- PHP Warning: Undefined array key when trying to access unavailable key from parent context
- Possible bug with `$context['flags']['debug']`? HOT 1
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 lightncandy.