Last active
December 22, 2015 04:08
-
-
Save jesulink2514/ea17fa717f602f000a2f to your computer and use it in GitHub Desktop.
Motor de vista con soporte para temas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace MvcThemeable.Infraestructura | |
{ | |
public class ThemeViewEngine: RazorViewEngine | |
{ | |
public ThemeViewEngine(string tema) | |
{ | |
ViewLocationFormats = new[] | |
{ | |
"~/Views/Themes/"+tema + "/{1}/{0}.cshtml", | |
"~/Views/Themes/"+tema + "/Shared/{0}.cshtml" | |
}; | |
PartialViewLocationFormats = new[] | |
{ | |
"~/Views/Themes/"+tema + "/{1}/{0}.cshtml", | |
"~/Views/Themes/"+tema + "/Shared/{0}.cshtml" | |
}; | |
AreaViewLocationFormats = new[] | |
{ | |
"~/Areas/{2}/Views/Themes/"+tema + "/{1}/{0}.cshtml", | |
"~/Areas/{2}/Views/Themes/"+tema + "/Shared/{0}.cshtml" | |
}; | |
AreaPartialViewLocationFormats = new[] | |
{ | |
"~/Areas/{2}/Views/Themes/"+tema + "/{1}/{0}.cshtml", | |
"~/Areas/{2}/Views/Themes/"+tema + "/Shared/{0}.cshtml" | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment