petermichaux / maria

The MVC framework for JavaScript applications. The real MVC. The Smalltalk MVC. The Gang of Four MVC.
BSD 2-Clause "Simplified" License
765 stars 51 forks source link

Template functions rather than strings ... #73

Closed jamesladd closed 10 years ago

jamesladd commented 10 years ago

Maria is great and I have used it for a couple of projects that went onto production.

I was hoping that HTML templates could be functions rather than strings to allow some rudimentary combinatorial use?

Maybe you could detect if the type was a function and call accordingly?

petermichaux commented 10 years ago

How about overriding one of the following methods in a plugin?

The idea is that everything in Maria should be possible to change with a plugin. If a plugin needs some flexibility that Maria doesn't provide then that can be discussed as immediate changes in Maria. If something can be written as a plugin and that plugin proves to be a generally useful extension to Maria in a variety of situations then it can be considered for inclusion.

jamesladd commented 10 years ago

ok. Now to remember how to make a plugin ;)

On Tue, Feb 25, 2014 at 2:18 PM, Peter Michaux notifications@github.comwrote:

How about overriding one of the following methods in a plugin?

  • maria.ElementView.prototype.getTemplate
  • maria.ElementView.prototype.buildTemplate

The idea is that everything in Maria should be possible to change with a plugin. If a plugin needs some flexibility that Maria doesn't provide then that can be discussed as immediate changes in Maria. If something can be written as a plugin and that plugin proves to be a generally useful extension to Maria in a variety of situations then it can be considered for inclusion.

Reply to this email directly or view it on GitHubhttps://github.com/petermichaux/maria/issues/73#issuecomment-35970967 .

petermichaux commented 10 years ago

Good luck. If you have any troubles, come back for more.