This View class overrides render and findViewFile
to use the theme view files
492540
public function render($view, $params = array(), $context = null)
    {
        if ($context === null) {
            $context = $this->context;
        }

        return parent::render($view, $params, $context);
    }
584133
private function setViewPath()
    {
        $viewPath = (strpos($this->getTwigViewPath(), '.') == true) ?
            str_replace('.', DS, $this->getTwigViewPath()) :
            $this->getTwigViewPath();

        $this->setTemplateLocation($this->container->get('app.path').DS.$viewPath.DS);
    }
1188832
def _load_view(self, template_engine_name, template_dir):
        
        file_name = template_engine_name.lower()
        class_name = "{}View".format(template_engine_name.title())
        try:
            view_module = import_module("rails.views.{}".format(file_name))
        except ImportError:
            raise Exception("Template engine '{}' not found in 'rails.views'".format(file_name))
        view_class = getattr(view_module, class_name)
        return view_class(template_dir)
956659
async function render(view, options) {
    view += settings.viewExt;
    const viewPath = path.join(settings.root, view);
    debug(`render: ${viewPath}`);
    // get from cache
    if (settings.cache && cache[viewPath]) {
      return cache[viewPath].call(options.scope, options);
    }

    const tpl = await fs.readFile(viewPath, 'utf8');

    // override `ejs` node_module `resolveInclude` function
    ejs.resolveInclude = function(name, filename, isDir) {
      if (!path.extname(name)) {
        name += settings.viewExt;
      }
      return parentResolveInclude(name, filename, isDir);
    }

    const fn = ejs.compile(tpl, {
      filename: viewPath,
      _with: settings._with,
      compileDebug: settings.debug && settings.compileDebug,
      debug: settings.debug,
      delimiter: settings.delimiter
    });
    if (settings.cache) {
      cache[viewPath] = fn;
    }

    return fn.call(options.scope, options);
  }
765215
function View(context, type, parentView, data, template, key, onRender) {
		// Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)
		var views, parentView_,
			isArray = type === "array",
			self_ = {
				key: 0,
				useKey: isArray ? 0 : 1,
				id: "" + viewId++,
				onRender: onRender,
				bnd: {}
			},
			self = {
				data: data,
				tmpl: template,
				views: isArray ? [] : {},
				parent: parentView,
				ctx: context,
				type: type,
				// If the data is an array, this is an 'array view' with a views array for each child 'item view'
				// If the data is not an array, this is an 'item view' with a views 'map' object for any child nested views
				// ._.useKey is non zero if is not an 'array view' (owning a data array). Uuse this as next key for adding to child views map
				get: getView,
				getIndex: getIndex,
				getRsc: getResource,
				hlp: getHelper,
				_: self_
		};

		if (parentView) {
			views = parentView.views;
			parentView_ = parentView._;
			if (parentView_.useKey) {
				// Parent is an 'item view'. Add this view to its views object
				// self._key = is the key in the parent view map
				views[self_.key = "_" + parentView_.useKey++] = self;
			} else {
				// Parent is an 'array view'. Add this view to its views array
				views.splice(
					// self._.key = self.index - the index in the parent view array
					self_.key = self.index =
						key !== undefined
							? key
							: views.length,
				0, self);
			}
			// If no context was passed in, use parent context
			// If context was passed in, it should have been merged already with parent context
			self.ctx = context || parentView.ctx;
		}
		return self;
	}
58284
def application_view(&block)
      template = read_file('layout/application', 'haml')
      Haml::Engine.new(template).render(self, &block)
    end
1209849
public function renderView()
    {
        if ($this->class) {
            $this->template->append('class', implode(' ', $this->class));
        }

        if ($this->style) {
            $style = $this->style;
            array_walk(
                $style,
                function (&$item, $key) {
                    $item = $key.':'.$item;
                }
            );
            $this->template->append('style', implode(';', $style));
        }

        if ($this->ui) {
            if (is_string($this->ui)) {
                $this->template->set('_class', $this->ui);
            }
        } else {
            $this->template->tryDel('_ui');
        }

        if ($this->id) {
            $this->template->trySet('_id', $this->id);
        }

        if ($this->element) {
            $this->template->set('_element', $this->element);
        }

        if ($this->attr) {
            $tmp = [];
            foreach ($this->attr as $attr => $val) {
                $tmp[] = $attr.'="'.$this->app->encodeAttribute($val).'"';
            }
            $this->template->setHTML('attributes', implode(' ', $tmp));
        }
    }
1289052
function renderTemplateLoader(source) {
  // Get the loader options object.
  var options = getOptions(this)
  // Get the template locals.
  var locals = getLocals.call(this, options)
  // Create info object of the filename of the resource being loaded.
  var info = { filename: this.resourcePath }
  // Get the engine options to be passed to the engine.
  var engineOptions = getEngineOptions.call(this, options.engineOptions, info)
  // Get the template renderer
  var renderer = getRenderer.call(this, options.engine)
  // Call options.init.
  init.call(this, renderer.engine, info, options)
  // Render the template
  var result = render(renderer, source, locals, engineOptions)
  // Assign the tempate to module.exports.
  return 'module.exports = ' + JSON.stringify(result)
}
34151
protected function loadViewThemeObject()
    {
        $env = Environment::get();
        $app = Facade::getFacadeApplication();
        $tmpTheme = $app->make(ThemeRouteCollection::class)
            ->getThemeByRoute($this->getViewPath());
        if (isset($tmpTheme[0])) {
            $this->themeHandle = $tmpTheme[0];
        }

        if ($this->themeHandle) {
            switch ($this->themeHandle) {
                case VIEW_CORE_THEME:
                    $this->themeObject = new \Concrete\Theme\Concrete\PageTheme();
                    $this->pkgHandle = false;
                    break;
                case 'dashboard':
                    $this->themeObject = new \Concrete\Theme\Dashboard\PageTheme();
                    $this->pkgHandle = false;
                    break;
                default:
                    if (!isset($this->themeObject)) {
                        $this->themeObject = PageTheme::getByHandle($this->themeHandle);
                        $this->themePkgHandle = $this->themeObject->getPackageHandle();
                    }

            }
            $this->themeAbsolutePath = $env->getPath(DIRNAME_THEMES.'/'.$this->themeHandle, $this->themePkgHandle);
            $this->themeRelativePath = $env->getURL(DIRNAME_THEMES.'/'.$this->themeHandle, $this->themePkgHandle);
        }
    }
68557
def render_view(view_name, **args):
    ''''''
    try:
        root_xml = get_view_root(view_name)
        return render(root_xml, **args)
    except CoreError as error:
        error.add_view_info(ViewInfo(view_name, None))
        raise
    except:
        info = exc_info()
        error = ViewError('Unknown error occured during rendering', ViewInfo(view_name, None))
        error.add_cause(info[1])
        raise error from info[1]
49188
def render(view_name = nil, context: Attributor::DEFAULT_ROOT_CONTEXT, renderer: Renderer.new, **opts)
      if !view_name.nil?
        warn 'DEPRECATED: please do not pass the view name as the first parameter in Blueprint.render, pass through the view: named param instead.'
      elsif opts.key?(:view)
        view_name = opts[:view]
      end

      fields = opts[:fields]
      view_name = :default if view_name.nil? && fields.nil?

      if view_name
        unless (view = self.class.views[view_name])
          raise "view with name '#{view_name.inspect}' is not defined in #{self.class}"
        end
        return view.render(self, context: context, renderer: renderer)
      end

      # Accept a simple array of fields, and transform it to a 1-level hash with true values
      if fields.is_a? Array
        fields = fields.each_with_object({}) { |field, hash| hash[field] = true }
      end

      # expand fields
      expanded_fields = FieldExpander.expand(self.class, fields)

      renderer.render(self, expanded_fields, context: context)
    end
929938
public function registerViewFinder()
    {
        // since view.find should be registered, lets get the paths and hints - in case they have changed
        $oldFinder = [];
        if ($this->app->resolved('view.finder')) {
            $oldFinder['paths'] = $this->app['view']->getFinder()->getPaths();
            $oldFinder['hints'] = $this->app['view']->getFinder()->getHints();
        }

        // recreate the view.finder
        $this->app->bind('view.finder', function ($app) use ($oldFinder) {

            $paths = (isset($oldFinder['paths']))?array_unique(array_merge($app['config']['view.paths'], $oldFinder['paths']), SORT_REGULAR):$app['config']['view.paths'];

            $viewFinder = new FileViewFinder($app['files'], $paths);

            if (!empty($oldFinder['hints'])) {
                array_walk($oldFinder['hints'], function($value, $key) use ($viewFinder) {
                    $viewFinder->addNamespace($key, $value);
                });
            }

            return $viewFinder;
        });
    }
451923
public void writeFileMakeViews()
    {
        if (this.readThisMethod("makeScreen"))
        {
            this.writeThisMethod(CodeType.THICK);
            return;     // if no views specified, use default methods
        }
        
        if (true)
        {
            ClassInfo recClassInfo = (ClassInfo)this.getMainRecord();
            ClassFields recClassFields = new ClassFields(this);
            recClassFields.addListener(new SubFileFilter(ClassFields.CLASS_INFO_CLASS_NAME_KEY, recClassInfo.getField(ClassInfo.CLASS_NAME)));   // Only read through the class fields
            recClassFields.close();
            try {
                boolean firstTime = true;
                while (recClassFields.hasNext())
                {
                    recClassFields.next();
                    String strClassFieldType = recClassFields.getField(ClassFields.CLASS_FIELDS_TYPE).toString();
                    if (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.SCREEN_CLASS_NAME))
                    {
                        if (firstTime)
                        {
                            this.writeMethodInterface(null, "makeScreen", "ScreenParent", "ScreenLoc itsLocation, ComponentParent parentScreen, int iDocMode, Map<String,Object> properties", "", "Make a default screen.", null);
                            m_StreamOut.writeit("\tScreenParent screen = null;\n");
                        }
                        String screenMode = recClassFields.getField(ClassFields.CLASS_FIELD_INITIAL_VALUE).toString();
                        if ((screenMode == null) || (screenMode.length() == 0))
                            screenMode = "MAINT_MODE";
                        if (!screenMode.contains("."))
                            screenMode = "ScreenConstants." + screenMode;
                        String fieldName = recClassFields.getField(ClassFields.CLASS_FIELD_NAME).toString();
                        if (firstTime)
                            m_StreamOut.writeit("\t");
                        else
                            m_StreamOut.writeit("\telse ");
                        m_StreamOut.write("if ((iDocMode & " + screenMode + ") == " + screenMode + ")\n");
                        m_StreamOut.writeit("\t\tscreen = Record.makeNewScreen(" + fieldName + ", itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);\n");
                        firstTime = false;
                    }
                }
                if (!firstTime)
                {
                    m_StreamOut.writeit("\telse\n");
                    m_StreamOut.writeit("\t\tscreen = super.makeScreen(itsLocation, parentScreen, iDocMode, properties);\n");
                    m_StreamOut.writeit("\treturn screen;\n}\n");                    
                }
            } catch (DBException e) {
                e.printStackTrace();
            }
        }
    }
415058
private function renderViewFile()
    {
        try {

            ob_start();
            extract($this->view_data);

            /** @noinspection PhpIncludeInspection */
            include($this->view_file);

            return trim(ob_get_clean(), "\n");

        } catch (\Exception $e) {

            ob_end_clean();
            throw $e;
        }
    }
1157268
function (options) {
    this.matchingJadeFilePath = options.matchingJadeFilePath;
    this.htmlFilePath = options.htmlFilePath;
    this.lastRenderToFile = undefined;
    this.jadeOptions = (typeof options.jadeOptions === 'undefined') ? { pretty: true } : options.jadeOptions;
}
342588
public function render()
    {
        // Prepare details
        $path       = $this->config['settings']['path'];
        $name       = $this->config['settings']['name'] . '/';
        $template   = 'index.tpl.php';
        $functions  = 'functions.php';

        // Include theme specific functions file
        $file = $path . $name . $functions;
        if (is_readable($file)) {
            include $file;
        }

        // Create views for regions, from config-file
        if (isset($this->config['views'])) {
            foreach ($this->config['views'] as $view) {
                $this->di->views->add($view['template'], $view['data'], $view['region'], $view['sort']);
            }
        }

        // Sen response headers, if any.
        $this->di->response->sendHeaders();

        // Create a view to execute the default template file
        $tpl  = $path . $name . $template;
        $data = array_merge($this->config['data'], $this->data);
        $view = $this->di->get('view');
        $view->set($tpl, $data);
        $view->setDI($this->di);
        $view->render();
    }
1016927
function (cb) {
            var self = this;

            Y.prepare([DEFAULT_THEME, themeDir], self.getProjectMeta(), function (err, opts) {
                opts.meta.title = self.data.project.name;
                opts.meta.projectRoot = './';
                opts.meta.projectAssets = './assets';
                opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts);
                opts = self.populateClasses(opts);
                opts = self.populateModules(opts);

                var view = new Y.DocView(opts.meta);
                self.render('{{>index}}', view, opts.layouts.main, opts.partials, function (err, html) {
                    self.files++;
                    cb(html, view);
                });
            });
        }