Giter Site home page Giter Site logo

Comments (5)

cpojer avatar cpojer commented on July 22, 2024

Hey,

thank you for your report. This totally makes sense but we are not likely to extend String.substitute in MooTools Core. The version in MooTools Core is intended for minor use cases only.

If you can think of a proper Template Class or similar and want to build it, we are more than happy to add it to MooTools More :)

from mootools-core.

allochi avatar allochi commented on July 22, 2024

Hi again,

I built one, how do I share with Mootools team to see if it can be accepted in More?

from mootools-core.

cpojer avatar cpojer commented on July 22, 2024

Either here: https://github.com/mootools/mootools-more

or on the Mailing List: https://groups.google.com/forum/#!forum/mootools-users

I think it would be better to show it with demos etc. on the mailing list so we can discuss it. Note that what I have in mind is supposed to be a fully featured template engine and not just simple text-replace.

from mootools-core.

allochi avatar allochi commented on July 22, 2024

Thanks, I will organize my code and examples and post them for discussions.

What I have is more than extending substitute, I have a class that extract HTML from the page or take an element constructed with new Element(), and use it as a template, fill it using an object or array, and insert the result back as many times as needed, it's also smart enough to know if the object used as a data source is an array and insert multiple one for each element say to fill a list.

I also added an in-element template, something that looks for an expression/word in side an element and surround it with a template, to be used for example as highlighter.

I hope it will be good enough to be added to More as a thank you Mootools contribution.

from mootools-core.

allochi avatar allochi commented on July 22, 2024

Hay, Have a look at this, I will post it in Mootools More too!

http://allochi.wordpress.com/2011/08/19/mootools-html-templates/

from mootools-core.

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.