Spark View Engine は、Razor のように C# コード ブロックを処理できますか? たとえば、Razor には次のようなものがあります。
@{
var currentController = ViewContext.RouteData.Values["controller"] as string ?? "Home";
var currentAction = ViewContext.RouteData.Values["action"] as string ?? "Index";
var currentPage = (currentController + "-" + currentAction ).ToLower();
}
これに相当するものは、Spark View Engine にあるでしょうか? 次に、Razor でそのようにコードを使用しています。Spark でも同じようにしたいと考えています。
<li @(currentPage == "home-index" ? "class = current" : "")>
@Html.ActionLink("Home", "Index", "Home")
</li>