/// <summary> /// 从缓存中读取部分模板内容 /// </summary> /// <param name="templateId"></param> /// <returns></returns> internal static string ReadPartial(string templateId) { if (TemplateCache.Exists(templateId)) { return(TemplateCache.GetTemplateContent(templateId)); } return(null); }
/// <summary> /// 从缓存中读取部分模板内容 /// </summary> /// <param name="templateName"></param> /// <returns></returns> internal static string ReadPartial(string templateName) { var partName = templateName.Replace(".html", ""); if (partName.Length > 0 && partName[0] != '/') { partName = "/" + partName; } if (TemplateCache.Exists(partName)) { return(TemplateCache.GetTemplateContent(partName)); } return(null); }
/// <summary> /// 是否存在模板 /// </summary> /// <param name="templatePath"></param> /// <returns></returns> public static bool Exists(String templatePath) { return(TemplateCache.Exists(templatePath)); }