Created
September 16, 2011 15:37
-
-
Save citizenmatt/1222387 to your computer and use it in GitHub Desktop.
Spark using ThemeDescriptorFilter
This file contains hidden or 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
public ActionResult Blah() | |
{ | |
return View(); | |
} |
This file contains hidden or 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
<html> | |
<head> | |
<title>Stuff</title> | |
</head> | |
<body> | |
things | |
<use file="_mypartial" /> | |
</body> | |
<html> |
This file contains hidden or 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
<h1>SAUSAGES!</h1> |
This file contains hidden or 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 Spark; | |
using Spark.Web.Mvc; | |
using Spark.Web.Mvc.Descriptors; | |
[assembly: WebActivator.PreApplicationStartMethod(typeof(SparkThemes.App_Start.SparkWebMvc), "Start")] | |
namespace SparkThemes.App_Start { | |
public static class SparkWebMvc { | |
public static void Start() { | |
var settings = new SparkSettings(); | |
settings.SetAutomaticEncoding(true); | |
var container = SparkEngineStarter.CreateContainer(settings); | |
container.AddFilter(ThemeDescriptorFilter.For(context => "Matt")); | |
// Note: you can change the list of namespace and assembly | |
// references in Views\Shared\_global.spark | |
SparkEngineStarter.RegisterViewEngine(container); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment