Skip to content

Commit

Permalink
add utility method to append all associations as HTML attributes exce…
Browse files Browse the repository at this point in the history
…pt those for given keys
  • Loading branch information
darkv committed Jul 12, 2012
1 parent 3ceba09 commit 3b2d8b3
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,30 @@ public static void appendHtmlAttributes(NSDictionary<String, WOAssociation> asso
ERXComponentUtilities.appendHtmlAttribute(key, association, response, component);
}
}

/**
* Appends a dictionary of associations as HTML attributes.
*
* @param associations
* the associations dictionary
* @param excludeKeys
* the associations to ignore
* @param response
* the response to write to
* @param component
* the component to evaluate the associations within
*/
public static void appendHtmlAttributes(NSDictionary<String, WOAssociation> associations, NSArray<String> excludeKeys, WOResponse response, WOComponent component) {
if (excludeKeys == null) {
excludeKeys = NSArray.EmptyArray;
}
for (String key : associations.allKeys()) {
if (!excludeKeys.contains(key)) {
WOAssociation association = associations.objectForKey(key);
ERXComponentUtilities.appendHtmlAttribute(key, association, response, component);
}
}
}

/**
* Appends an association as an HTML attribute.
Expand Down

0 comments on commit 3b2d8b3

Please sign in to comment.