JMSTwigJsBundle icon indicating copy to clipboard operation
JMSTwigJsBundle copied to clipboard

Twig.js update?

Open USvER opened this issue 11 years ago • 8 comments

There is missing filters. Like date format and number format... Looking at latest Twig.js sources i can see them... But can't use in my project... Manualy updating Twig.js file don't help... It just different file... And it is highly obfuscated... even in dev version...

USvER avatar Jan 04 '14 19:01 USvER

The date filter doesn't exist in Twig.js as far as I know. See issue #11 in the actual Twig.js repo. It can't really be implemented with the exact same functionality as Twig (PHP) without a lot of code.

I had to add my own runtime filter. It's not too hard to do. I just kept it simple and only supported the date character parameters I needed.

adam-lynch avatar Jan 04 '14 19:01 adam-lynch

I think you are wrong! https://github.com/justjohn/twig.js/blob/master/twig.js#L1255

USvER avatar Jan 04 '14 22:01 USvER

Oh... two different "twig.js" projects... and why this one was chosen to be in the bundle...

PS: I was using swig.js with my recent nodejs project, and i was more or less happy... But i'm totaly unhappy with this bundle... =\

USvER avatar Jan 04 '14 22:01 USvER

@adam-lynch How did you add runtime filter? Can't get it to work... #34

USvER avatar Jan 07 '14 08:01 USvER

@adam-lynch Same for Compile time... Can't get a compiler to configure it...

USvER avatar Jan 07 '14 08:01 USvER

@USvER hmm, I don't remember exactly. See my issue back from back then (#18), it might help.

I just noticed a few other issues now about adding filters. Hmm.

adam-lynch avatar Jan 07 '14 10:01 adam-lynch

Oh, I meant to say that I don't have access to that code anymore.

adam-lynch avatar Jan 07 '14 10:01 adam-lynch

@adam-lynch Assetic gives me 500 error on templates that use not existing at compile-time filters #34, and #18 does not give me a clue why it's happen...

USvER avatar Jan 07 '14 17:01 USvER