/// <summary> /// 获取App的网址。最后的效果包括后缀名,比如 /Forum1/Forum/Index.aspx /// </summary> /// <param name="app"></param> /// <param name="ctx"></param> /// <returns></returns> public static String ToApp(IApp app, MvcContext ctx) { // 1) html if (ctx != null && ctx.IsMock && ctx.GetItem("_makeHtml") != null) { return(HtmlLink.ToApp(app)); } String appName = strUtil.TrimEnd(app.GetType().Name, "App"); // 2) link map String controller = appName + "/" + appName; String x = LinkMap.To(app.OwnerType, app.OwnerUrl, controller, "Index", app.Id); if (x != null) { return(x); } // 3) String ret = getAppLink(app.OwnerType, app.OwnerUrl, appName, app.Id); if (MvcConfig.Instance.IsUrlToLower) { return(ret.ToLower()); } return(ret); }
/// <summary> /// 获取App的网址。最后的效果包括后缀名,比如 /Forum1/Forum/Index.aspx /// </summary> /// <param name="app"></param> /// <param name="ctx"></param> /// <returns></returns> public static String ToApp(IApp app, MvcContext ctx) { if (ctx != null && ctx.IsMock && ctx.GetItem("_makeHtml") != null) { return(HtmlLink.ToApp(app)); } String appName = strUtil.TrimEnd(app.GetType().Name, "App"); return(getAppLink(app.OwnerType, app.OwnerUrl, appName, app.Id)); }
/// <summary> /// 获取App的网址。最后的效果包括后缀名,比如 /Forum1/Forum/Index.aspx /// </summary> /// <param name="app"></param> /// <param name="ctx"></param> /// <returns></returns> public static String ToApp(IApp app, MvcContext ctx) { if (ctx != null && ctx.IsMock && ctx.GetItem("_makeHtml") != null) { return(HtmlLink.ToApp(app)); } String appName = strUtil.TrimEnd(app.GetType().Name, "App"); String ret = getAppLink(app.OwnerType, app.OwnerUrl, appName, app.Id); if (MvcConfig.Instance.IsUrlToLower) { return(ret.ToLower()); } return(ret); }