-
Notifications
You must be signed in to change notification settings - Fork 0
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
It's not a bug #1
Comments
The way I did it here: https://github.com/eiskalteschatten/typescript-static-blog/blob/main/src/app.ts works for me and I do use it in my ejs files (for example, here: https://github.com/eiskalteschatten/typescript-static-blog/blob/main/templates/_blog/post.ejs). How are you importing your helpers? If you have a loose collection of functions (like in https://github.com/eiskalteschatten/typescript-static-blog/blob/main/src/lib/ejsHelpers.ts), then you will need to import it with a * like this: |
@eiskalteschatten I have a plugin with this
The controller is :
I missed any thing ? Thank's for your reply. |
Hi, I need to format datetime into an EJS template, using @fastify/view v9.0.0.
I think to create an helper with my function and pass it on the fastify.view command
const htmlContent = await fastify.view(template, { rfq } )
I have add an hook as is :
where ejsHelpers contains my custom "formatLocaleDateTime" function.
So, how to pass the helper so that its functions are usable during the rendering phase of the EJS template?
My goal is to use : <%= helpers.formatLocaleDateTime (date()) %>
The error is
helpers is not defined
.With best compliments for your work. Thank you.
The text was updated successfully, but these errors were encountered: