mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Keeping the view engine collection from growing on each request
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044174
This commit is contained in:
@@ -38,7 +38,7 @@ namespace Orchard.Environment {
|
||||
.WithArguments(new NamedParameter("paths", new[] { "~/Core", "~/Packages" }))
|
||||
.SingletonScoped();
|
||||
builder.Register<ThemeFolders>().As<IExtensionFolders>()
|
||||
.WithArguments(new NamedParameter("paths", new[] { "~/Core/Themes", "~/Themes" })) // <- info: (heskew) ~/Core/Themes is itself an extension, is that too wrong/weird?
|
||||
.WithArguments(new NamedParameter("paths", new[] { "~/Core", "~/Themes" }))
|
||||
.SingletonScoped();
|
||||
|
||||
registrations(builder);
|
||||
|
@@ -28,6 +28,8 @@ namespace Orchard.Mvc.Html {
|
||||
html.ViewContext.HttpContext.Response.Output.Write(layoutContext.Title);
|
||||
}
|
||||
|
||||
public static void RenderZone(this HtmlHelper html, string zoneName, string foo) {}
|
||||
|
||||
public static void RegisterStyle(this HtmlHelper html, string styleName) {
|
||||
//todo: register the style
|
||||
}
|
||||
|
@@ -1,4 +1,3 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -67,7 +66,7 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
|
||||
var layoutViewEngine = new LayoutViewEngine(requestViewEngines);
|
||||
|
||||
viewResultBase.ViewEngineCollection = new ViewEngineCollection(_viewEngines);
|
||||
viewResultBase.ViewEngineCollection = new ViewEngineCollection(_viewEngines.ToList());
|
||||
viewResultBase.ViewEngineCollection.Insert(0, layoutViewEngine);
|
||||
}
|
||||
|
||||
|
@@ -54,6 +54,7 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
|
||||
viewEngine.PartialViewLocationFormats = parameters.VirtualPaths
|
||||
.Select(x => x + "/Views/Shared/{0}.ascx")
|
||||
.Concat(parameters.VirtualPaths.Select(s => s + "/Views/Shared/{0}.aspx"))
|
||||
.ToArray();
|
||||
|
||||
return viewEngine;
|
||||
|
Reference in New Issue
Block a user