Search in sources :

Example 26 with Contents

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 "";
}
Also used : Contents(com.tale.model.Contents)

Aggregations

Contents (com.tale.model.Contents)26 TipException (com.tale.exception.TipException)8 Take (com.blade.jdbc.core.Take)7 Users (com.tale.model.Users)4 Paginator (com.blade.jdbc.model.Paginator)2 MetaDto (com.tale.dto.MetaDto)2 Metas (com.tale.model.Metas)2 InterpretContext (jetbrick.template.runtime.InterpretContext)2 PageRow (com.blade.jdbc.model.PageRow)1 Route (com.blade.mvc.annotation.Route)1 Statistics (com.tale.dto.Statistics)1 Comments (com.tale.model.Comments)1 Logs (com.tale.model.Logs)1 Relationships (com.tale.model.Relationships)1