@Component public class CmsDictionaryDataDirective extends AbstractTemplateDirective
参数列表
dictionaryId
:数据字典id
value
值,结果返回object
CmsDictionaryData
values
多个值,逗号或空格间隔,当value为空时生效,结果返回map
(id,object
)
<@cms.dictionaryData dictionaryId='data' value='1'>${object.text}</@cms.dictionaryData>
<@cms.dictionaryData dictionaryId values='1,2,3'><#list map as k,v>${k}:${v.text}<#sep>,</#list></@cms.dictionaryData>
<script> $.getJSON('${site.dynamicPath}api/directive/cms/dictionaryData?dictionaryId=data&value=1', function(data){ console.log(data.text); }); </script>
限定符和类型 | 字段和说明 |
---|---|
private CmsDictionaryDataService |
service |
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
CmsDictionaryDataDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
execute, expose, getAdvanced, getApp, getSite, getUserId, needAppToken, needUserToken, supportAdvanced
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
private CmsDictionaryDataService service
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException