Code Monkey home page Code Monkey logo

Comments (8)

zordius avatar zordius commented on May 25, 2024

partial and ../ suppport is in the plan and will be done before Q2 end. I think these 2 features can track by open new issues. If you have more feature request, we can discuss in this issue, thanks.

from lightncandy.

M3kH avatar M3kH commented on May 25, 2024

I build my class template.php on top of lightncandy, for now I manage the partial in a different way.
I register the variable template is the keyword for load my other templates, following my personal routing rules, and when I found it I load the correct file and I pass the data needed inside lightncandy.

I already implemented the possibility to define variable inside the blocks with simply {$nameParam="param" 1="something" 2="something else"}.

The next my step is find the way to declare variable inside my personal partials so something like that:
{{{template.directory.directory.filename param="something"}}} where declare the variable {{param}} with something.

Do you think would be useful have inside your library?

P.S. At this moment my partial function is not really a elastic method because is created just for my situation, I think would be good to create a function are able to load from file or from a callback where it's return a string.

from lightncandy.

zordius avatar zordius commented on May 25, 2024

My plan is to include partial template when 'compile time' , then it is simple to generate a single compiled php code. And I will add a new option for compile() to specify templates base directory, that should be good because I saw this design pattern on many other handlebars libs. The partial support will be done right after '../' support (Now I am working on it) , I think it will be rollout in 1 week.

from lightncandy.

M3kH avatar M3kH commented on May 25, 2024

I really don't have clear when you talking about '../' and also have some problem to understanding other commands like 'width' or '.', 'this'.

What you think to make also a better test page fo explain the features inside the library? Do you need help for that?

And what about passing variables inside the partial loading? Do you like it?

from lightncandy.

zordius avatar zordius commented on May 25, 2024

Well, all features aligns with handlebars.js , you can find feature examples here: http://handlebarsjs.com/ , including #with, {{this}} and {{../vars}} .

from lightncandy.

zordius avatar zordius commented on May 25, 2024

now #with and {{../vars}} and {{>partial}} are all supported.

Now lightncandy partial support is done in compile time, this is different with handlebarsjs and mustache.js. With compile time partial support, the input variables and context is auto passed into the partial without any magic. I can not make sure this can fit your 'passing variables inside the partial loading' or not, maybe you can make a clean defination on it, thanks.

You can try partial feature now, I did not build full testing on partial feature now, but this will be done in 1 week.

I put all feature and performance tests in https://github.com/zordius/HandlebarsTest , it is not mean to be sample code or library test. So, better test page/files are welcome by making merge request.

from lightncandy.

M3kH avatar M3kH commented on May 25, 2024

Wow fantastic job.
What you think to have an Hangout? I want show you what I implemented in my "framework" so maybe we can discuss better how I can help you. If you want send me an email you can find me at ideabile[dot]com.

from lightncandy.

zordius avatar zordius commented on May 25, 2024

close for 1yr no follow up. Any doc are welcome by fork/pull request model, thanks.

from lightncandy.

Related Issues (20)

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.