Updated RenderMvcController to have the view engines test for file existance, rather than assuming views will always be razor. This allows alternative MVC view engines to be used.
This commit is contained in:
@@ -73,13 +73,13 @@ namespace Umbraco.Web.Mvc
|
||||
/// <returns></returns>
|
||||
protected bool EnsurePhsyicalViewExists(string template)
|
||||
{
|
||||
if (!System.IO.File.Exists(
|
||||
Path.Combine(Server.MapPath(Constants.ViewLocation), template + ".cshtml")))
|
||||
{
|
||||
LogHelper.Warn<RenderMvcController>("No physical template file was found for template " + template);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
var result = ViewEngines.Engines.FindView(ControllerContext, template, null);
|
||||
if(result.View == null)
|
||||
{
|
||||
LogHelper.Warn<RenderMvcController>("No physical template file was found for template " + template);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user