mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
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:
@@ -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) { }
|
||||||
|
Reference in New Issue
Block a user