/// <summary> /// Hàm khởi tạo /// </summary> /// <param name="falconConfig"></param> /// <param name="webHelper"></param> public ThemeProvider(FalconConfig falconConfig, IWebHelper webHelper) { _falconConfig = falconConfig; _webHelper = webHelper; basePath = webHelper.MapPath(falconConfig.ThemeBasePath); LoadConfigurations(); }
public ThemableRazorViewEngine() { FalconConfig falconConfig = EngineContext.Current.Resolve <FalconConfig>(); AreaViewLocationFormats = new[] { //default "~/Modules/{2}/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml", //Admin "~/AdminModules/{2}/Views/{1}/{0}.cshtml", "~/AdminModules/{2}/Views/Shared/{0}.cshtml", }; //AreaMasterLocationFormats = new[] // { // //default // "~/Areas/{2}/Views/{1}/{0}.cshtml", // "~/Areas/{2}/Views/Shared/{0}.cshtml" // }; AreaPartialViewLocationFormats = new[] { //default "~/Modules/{2}/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml", //Admin "~/AdminModules/{2}/Views/{1}/{0}.cshtml", "~/AdminModules/{2}/Views/Shared/{0}.cshtml", }; //ViewLocationFormats = new[] // { // //themes // "~/Themes/{2}/Views/{1}/{0}.cshtml", // "~/Themes/{2}/Views/Shared/{0}.cshtml", // //default // "~/Views/{1}/{0}.cshtml", // "~/Views/Shared/{0}.cshtml" // }; MasterLocationFormats = new[] { //themes falconConfig.ThemeBasePath + "{1}/Views/Layouts/{0}.cshtml", }; PartialViewLocationFormats = new[] { "~/Modules/{2}/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml", //Admin "~/AdminModules/{2}/Views/{1}/{0}.cshtml", "~/AdminModules/{2}/Views/Shared/{0}.cshtml", //themes falconConfig.ThemeBasePath + "{2}/Views/{1}/{0}.cshtml", }; FileExtensions = new[] { "cshtml" }; }