Mustache.cfc icon indicating copy to clipboard operation
Mustache.cfc copied to clipboard

basic extends template functionality

Open garyhiscox opened this issue 12 years ago • 8 comments

Hi Tony,

I have branched the extends functionality and added a MXUnit test - extendsTemplate()

Gary

garyhiscox avatar Dec 20 '12 12:12 garyhiscox

I didn't think extends was part of the Mustache spec. Did they add it recently?

dswitzer avatar Dec 20 '12 12:12 dswitzer

http://stackoverflow.com/questions/7925931/can-mustache-templates-do-template-extension

Currently mustache.java, hogan.js and phly_mustache support template inheritance. https://github.com/mustache/spec/issues/38

On 20 December 2012 12:58, Dan G. Switzer, II [email protected]:

I didn't think extends was part of the Mustache spec. Did they add it recently?

— Reply to this email directly or view it on GitHubhttps://github.com/rip747/Mustache.cfc/pull/21#issuecomment-11572451.

garyhiscox avatar Dec 20 '12 13:12 garyhiscox

I read all those threads before posting, but it's never been officially added to the language from what I can see.

Since we've been trying to keep Mustache.cfc to support what's in the official spec, what I'd do is create a sub-class of Mustache and add the functionality to that component--which should be fairly straightforward.

That way we expose the functionality for those that want it and if it becomes official, we push into into the base Mustache.cfc.

Does that make sense?

dswitzer avatar Dec 20 '12 13:12 dswitzer

what is the status of this? are we going to merge it?

rip747 avatar Jan 04 '13 00:01 rip747

It's not actually part of the official spec as far as I can tell, but there are implementations that support it. Seems like the best option would be to sub-class Mustache.cfc and include that in the build. That way we have the feature for those that need it, but don't have it in the base class.

On Thursday, January 3, 2013, Anthony Petruzzi wrote:

what is the status of this? are we going to merge it?

— Reply to this email directly or view it on GitHubhttps://github.com/rip747/Mustache.cfc/pull/21#issuecomment-11868052.

Dan G. Switzer, II [email protected] http://blog.pengoworks.com/

dswitzer avatar Jan 04 '13 00:01 dswitzer

that's an excellent idea.

rip747 avatar Jan 04 '13 02:01 rip747

That sounds like a good plan, Time is limited at the moment, I will rework the code into a sub-class as soon as possible.

On 4 January 2013 02:07, Anthony Petruzzi [email protected] wrote:

that's an excellent idea.

— Reply to this email directly or view it on GitHubhttps://github.com/rip747/Mustache.cfc/pull/21#issuecomment-11869750.

garyhiscox avatar Jan 04 '13 08:01 garyhiscox

no rush. take you time.

rip747 avatar Jan 04 '13 13:01 rip747