-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to the wizard to configure mustache engine #693
Comments
Is this to be able to handle some of the helper functionality that is defined by the underlying library ?
A simple change to
allows the use of inbuilt formatting functions etc so the following template will output a formatted date rather than an ISODateTime string
|
On a related note there is the ability to pass a translate callback to the TSynMustache renderJSON method. This too is not exposed. So the ability to configure the Mustache Engine before rendering templates would be very useful. I can have a go at some changes, as I have a new project where the ability to format ISO DateTimes via the template rather than via the json data would be extremely useful. |
From an initial examination it looks like some type of dependency injection is required for the TMVCBaseViewEngine.
I'm probably going to subclass the TMVCMustacheViewEngine to see if I can work something into here. |
My initial work is to add the following to the existing TMVCMustacheViewEngine class
and then change the Execute method to prepopulate the Helpers and make the call to the new method
|
And I can create a new subclass if I wanted to add additional features to the Mustache syntax e.g.
|
Just added some proposed code changes. I see you've been busy on the Mustache Rendering logic too. |
Just add an option in the "New DMVCFramework Project" to add something like the following:
MVCFramework.View.Renderers.Mustache.pas
is required in theuses
clause.The text was updated successfully, but these errors were encountered: