public void Render(ViewContext context, TextWriter writer) { var filename = context.HttpContext.Server.MapPath(ViewPath); var scope = new ScriptScopeImpl(ViewPath); var orchardGlobal = new Dictionary<string, dynamic>(); orchardGlobal["VIEW_CONTEXT"] = context; orchardGlobal["MODEL"] = new StaticShape(context.ViewData.Model); scope.SetVariable("_ORCHARD", orchardGlobal); var output = _phpRuntime.ExecuteFile(filename, scope); writer.Write(output); }
public void Render(ViewContext context, TextWriter writer) { var filename = context.HttpContext.Server.MapPath(ViewPath); var scope = new ScriptScopeImpl(ViewPath); var orchardGlobal = new Dictionary <string, dynamic>(); orchardGlobal["VIEW_CONTEXT"] = context; orchardGlobal["MODEL"] = new StaticShape(context.ViewData.Model); scope.SetVariable("_ORCHARD", orchardGlobal); var output = _phpRuntime.ExecuteFile(filename, scope); writer.Write(output); }