Adding html helper for rendering zone with callback for content

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044182
This commit is contained in:
loudej
2009-12-16 21:58:15 +00:00
parent 41324018f0
commit db2e53d086

View File

@@ -1,4 +1,5 @@
using System.Web.Mvc; using System;
using System.Web.Mvc;
using Orchard.Mvc.ViewEngines; using Orchard.Mvc.ViewEngines;
using Orchard.Mvc.ViewModels; using Orchard.Mvc.ViewModels;
using Orchard.UI.Zones; using Orchard.UI.Zones;
@@ -32,7 +33,12 @@ namespace Orchard.Mvc.Html {
} }
public static void Zone<TModel>(this HtmlHelper<TModel> html, string zoneName) where TModel : BaseViewModel { public static void Zone<TModel>(this HtmlHelper<TModel> html, string zoneName) where TModel : BaseViewModel {
Zone(html, zoneName, null); Zone(html, zoneName, string.Empty);
}
public static void Zone<TModel>(this HtmlHelper<TModel> html, string zoneName, Action action) where TModel : BaseViewModel {
html.ViewData.Model.Zones.AddAction(zoneName, x => action());
Zone(html, zoneName, string.Empty);
} }
public static void RenderZone(this HtmlHelper html, string zoneName, string foo) { } public static void RenderZone(this HtmlHelper html, string zoneName, string foo) { }