Skip to content

Instantly share code, notes, and snippets.

@aasikka
Created July 2, 2018 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aasikka/fe5e1edfb15c43238b15151ca8e4ff0f to your computer and use it in GitHub Desktop.
Save aasikka/fe5e1edfb15c43238b15151ca8e4ff0f to your computer and use it in GitHub Desktop.
@Model(adaptables = Resource.class, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class ContactUsModel {
private Style currentStyle;
private Designer designer;
@PostConstruct
protected void init() {
// Getting the currentStyle from the Designer.class
designer = this.resourceResolver.adaptTo(Designer.class);
if (designer != null) {
currentStyle = designer.getStyle(resource);
}
}
}
@SimpLe-Yu
Copy link

すごい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment