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);
        }
Beispiel #2
0
        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);
        }