Skip to content

Instantly share code, notes, and snippets.

@greenlaw110
Created May 23, 2012 22:24
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 greenlaw110/2778215 to your computer and use it in GitHub Desktop.
Save greenlaw110/2778215 to your computer and use it in GitHub Desktop.
For example, you have a part of content to be passed to different tags as callback, and you except the tag will change the content by passing arguments, as shown below:
bc. @lookupRole(permission: "superuser").callback(List<Role> roleList) {
<ul>
@for(Role role: roleList) {
<li>role.getName()</li>
}
</ul>
}
Later you decide to grab a list of roles with another permission:
bc. @lookupRole(permission: "db-admin").callback(List<Role> roleList) {
<ul>
@for(Role role: roleList) {
<li>role.getName()</li>
}
</ul>
}
And you found it's tedious to write the the same code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment