문제

Sorry that this is kind of a lazy questions...

I'm curious if $DateTime.Now.Year can be used with NVelocity templates to show the current year? Or do I need to set a variable?

도움이 되었습니까?

해결책

No, as far as I know NVelocity templates only work with objects set in the VelocityContext.

다른 팁

But there is no problem with adding your custom objects to the context and then use them in the template.

_context = new VelocityContext();
_context.Put("your_key", your_object);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top