use of com.tale.model.Contents in project tale by otale.
the class Theme method show_tags.
/**
* 显示标签
*
* @param split 每个标签之间的分隔符
* @return
*/
public static String show_tags(String split) throws UnsupportedEncodingException {
Contents contents = current_article();
if (StringKit.isNotBlank(contents.getTags())) {
String[] arr = contents.getTags().split(",");
StringBuffer sbuf = new StringBuffer();
for (String c : arr) {
sbuf.append(split).append("<a href=\"/tag/" + URLEncoder.encode(c, "UTF-8") + "\">" + c + "</a>");
}
return split.length() > 0 ? sbuf.substring(split.length() - 1) : sbuf.toString();
}
return "";
}
Aggregations