Skip to content
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

Qute: introduce template extensions with namespaces #11052

Closed
mkouba opened this issue Jul 29, 2020 · 0 comments · Fixed by #11093
Closed

Qute: introduce template extensions with namespaces #11052

mkouba opened this issue Jul 29, 2020 · 0 comments · Fixed by #11093
Assignees
Labels
area/qute The template engine kind/enhancement New feature or request
Milestone

Comments

@mkouba
Copy link
Contributor

mkouba commented Jul 29, 2020

API:

@TemplateExtension(namespace = "str") 
class StringUtils {
 
  String format(String fmt, String... args) {
      return String.format(fmt, args);
   }

   static String reverse(String val) {
      return new StringBuilder(val).reverse().toString();
   }
}

and the usage:

{str:format('Value is %s', foo)}
{str:reverse('hello')}

It's like "calling static methods from templates".

@mkouba mkouba added kind/enhancement New feature or request area/qute The template engine labels Jul 29, 2020
@mkouba mkouba added this to the 1.8.0 milestone Jul 30, 2020
@mkouba mkouba self-assigned this Jul 30, 2020
mkouba added a commit to mkouba/quarkus that referenced this issue Jul 30, 2020
@gsmet gsmet modified the milestones: 1.8.0 - master, 1.7.0.CR1 Jul 31, 2020
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants