主题 : 关于标签里面的键值对????在线等····· |
级别: 白丁
|
1# 发表于:2011-03-10 16:06:11 IP:123.240.*.*
|
||||
---|---|---|---|---|---|
级别: 白丁
|
3# 发表于:2011-03-10 16:13:52 IP:123.240.*.*
ContentListDirective类:
public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException { CmsSite site = FrontUtils.getSite(env); List<Content> list = getList(params, env); Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>( params); paramWrap.put(OUT_LIST, DEFAULT_WRAPPER.wrap(list)); Map<String, TemplateModel> origMap = DirectiveUtils .addParamsToVariable(env, paramWrap); InvokeType type = DirectiveUtils.getInvokeType(params); String listStyle = DirectiveUtils.getString(PARAM_STYLE_LIST, params); if (InvokeType.sysDefined == type) { if (StringUtils.isBlank(listStyle)) { throw new ParamsRequiredException(PARAM_STYLE_LIST); } env.include(TPL_STYLE_LIST + listStyle + TPL_SUFFIX, UTF8, true); } else if (InvokeType.userDefined == type) { if (StringUtils.isBlank(listStyle)) { throw new ParamsRequiredException(PARAM_STYLE_LIST); } FrontUtils.includeTpl(TPL_STYLE_LIST, site, env); } else if (InvokeType.custom == type) { FrontUtils.includeTpl(TPL_NAME, site, params, env); } else if (InvokeType.body == type) { body.render(env.getOut()); } else { throw new RuntimeException("invoke type not handled: " + type); } DirectiveUtils.removeParamsFromVariable(env, paramWrap, origMap); } 方法里的Environment env是什么 包含哪些值啊?和[@cms_content_list typeId='3' styleList='3-1' titLen='20' count='5' flashWidth='280' flashHeight='200' textHeight='20' channelOption='1' tpl='2'/]有什么关系??? |
||
---|---|---|---|
级别: 童生
|
4# 发表于:2011-03-10 16:26:00 IP:59.245.*.*
关于开发您可以去看看http://bbs.jeecms.com/fzjy/5349.htm
|
||
---|---|---|---|
1
共1页