类 CmsVoteItemDirective

所有已实现的接口:
Directive, HttpDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

@Component public class CmsVoteItemDirective extends AbstractTemplateDirective
voteItem 投票选项查询指令

参数列表

parameter list

パラメータリスト

  • id:投票选项id,结果返回object CmsVoteItem
  • ids: 多个投票选项id,逗号或空格间隔,当id为空时生效,结果返回map(id,object)

使用示例

usage example

使用例

<@cms.voteItem id=1>${object.title}</@cms.voteItem>

<@cms.voteItem ids='1,2,3'><#list map as k,v>${k}:${v.title}<#sep>,</#list></@cms.voteItem>

<script>
$.getJSON('${site.dynamicPath}api/directive/cms/voteItem?id=1', function(data){
  console.log(data.title);
});
</script>
 
  • 字段详细资料

  • 构造器详细资料

    • CmsVoteItemDirective

      public CmsVoteItemDirective()
  • 方法详细资料

    • execute

      public void execute(RenderHandler handler) throws IOException, freemarker.template.TemplateException
      参数:
      handler -
      抛出:
      IOException
      freemarker.template.TemplateException