Create an instance of `View`.
551977
function View(view, options) {
  this.history = [];
  Item.call(this, view, options);
  this.init(view);
  return view;
}
202640
protected function _initView ()
    {
        // Create default view model, to be used in all templates and layouts
        $this->appView  = new \Zend\View\Model\ViewModel();

        // Convenience access variables
        $this->_appView = $this->appView;
        $this->view     = $this->appView;
        $this->_view    = $this->appView;
    }
435509
def load_file(self, app, pathname, relpath, pypath):
        
        try:
            view_class = self.get_file_view_cls(relpath)
            return create_view_from_file(pathname, source_template=relpath, view_class=view_class)
        except DeclarativeViewError:
            pass
623808
def action(cls, view):
        """"""
        name = "%s:%s" % (cls.name, view.__name__)
        path = "%s/%s" % (cls.url, view.__name__)
        cls.actions.append((view.__doc__, path))
        return cls.register(path, name=name)(view)
505849
def register_view_for(cls, app, action, classview, attr):
        
        if 'view_for_endpoints' not in cls.__dict__:
            cls.view_for_endpoints = {}
        cls.view_for_endpoints.setdefault(app, {})[action] = (classview, attr)
857290
public static View create(String name, String map) {
        return new DefaultView(name, map, null);
    }
43331
def create_tree_view(self, model=None):
        
        tree_view = Gtk.TreeView()
        if model is not None:
            tree_view.set_model(model)
        return tree_view
193337
def get_view(self, request, view_class, opts=None):
        
        kwargs = {}
        if opts:
            if not isinstance(opts, dict):
                opts = opts.__dict__
        else:
            opts = {}

        if not view_class in VALID_MIXIN_OPTIONS:
            valid_options = view_class.__dict__.keys()
            for cls in view_class.__bases__:
                if cls != object:
                    valid_options += cls.__dict__.keys()
            VALID_MIXIN_OPTIONS[view_class] = valid_options

        for key in VALID_MIXIN_OPTIONS[view_class]:
            if key in opts:
                kwargs[key] = opts[key]
            elif hasattr(self, key):
                kwargs[key] = getattr(self, key)

        view = view_class(**kwargs)
        view.request = request
        view.kwargs = {}
        return view
637498
def init_form_view(self, view, opts):
        
        name = opts.get("name", opts.get("form"))
        if isinstance(name, Form):
            return

        template = opts.get("template", getattr(view, "template", None))
        if not template:
            if not name:
                raise NoFormError("No form name specified in the form action and no template")
            return

        try:
            as_ = opts.get("var_name", getattr(self.form, "as_", "form"))
            form_class = create_from_template(current_app, template, var_name=as_)
        except NoFormError:
            if not name:
                raise
            return

        if not name:
            name = view.name

        self.forms[name] = form_class
        self.form_created_from_view_signal.send(self, view=view, form_class=form_class)
        return form_class
835676
function View(bytes, elementType) {
    if (!(this instanceof View))
        return new View(bytes, elementType);
    this.bytes = bytes;
    this.elementType = elementType;
}
471336
def add_view(self,
                 view,
                 name=None,
                 position=None,
                 closable=False,
                 floatable=True,
                 floating=None):
        """"""

        # Set the name in the view.
        view.view_index = self._get_view_index(view)
        # The view name is `<class_name><view_index>`, e.g. `MyView0`.
        view.name = name or view.__class__.__name__ + str(view.view_index)

        # Get the Qt canvas for VisPy and matplotlib views.
        widget = _try_get_vispy_canvas(view)
        widget = _try_get_matplotlib_canvas(widget)

        dock_widget = _create_dock_widget(widget, view.name,
                                          closable=closable,
                                          floatable=floatable,
                                          )
        self.addDockWidget(_get_dock_position(position), dock_widget)
        if floating is not None:
            dock_widget.setFloating(floating)
        dock_widget.view = view

        # Emit the close_view event when the dock widget is closed.
        @dock_widget.connect_
        def on_close_widget():
            self.emit('close_view', view)

        dock_widget.show()
        self.emit('add_view', view)
        logger.log(5, "Add %s to GUI.", view.name)
        return dock_widget
222007
function(view)
	{
		if (arguments.length > 1)
		{
			conbo.forEach(arguments, function(view, index, list) 
			{
				this.prependView(view);
			}, 
			this);
			
			return this;
		}
	
		if (typeof view === 'function')
		{
			view = new view(this.context);
		}
		
		if (!(view instanceof conbo.View))
		{
			throw new Error('Parameter must be conbo.View class or instance of it');
		}
		
		var firstChild = this.body.firstChild;
		
		firstChild
			? this.body.insertBefore(view.el, firstChild)
			: this.appendView(view);
		
		return this;
	}
357444
def as_view(cls, view_type, *init_args, **init_kwargs):
        
        global _method

        new_cls = type(
            cls.__name__ + '_' + _BridgeMixin.__name__ + '_restless',
            (_BridgeMixin, cls._request_handler_base_,),
            dict(
                __resource_cls__=cls,
                __resource_args__=init_args,
                __resource_kwargs__=init_kwargs,
                __resource_view_type__=view_type)
        )

        """
        Add required http-methods to the newly created class
        We need to scan through MRO to find what functions users declared,
        and then add corresponding http-methods used by Tornado.
        """
        bases = inspect.getmro(cls)
        bases = bases[0:bases.index(Resource)-1]
        for k, v in cls.http_methods[view_type].items():
            if any(v in base_cls.__dict__ for base_cls in bases):
                setattr(new_cls, k.lower(), _method)

        return new_cls
738122
private function createView($view, $viewFile, $type, $moduleDir)
    {
        $template = file_get_contents(
            __DIR__.DIRECTORY_SEPARATOR."templates".DIRECTORY_SEPARATOR."view_".$type.".tpl"
        );

        $template = str_replace('$VIEW', $view, $template);

        file_put_contents($viewFile, $template);
    }
819494
function initViews (args) {
    // create views register for model indexed by view name - these names
    // are not required to be the same as global view names
    this.views = {}
    // validate each defined view, get view model if needed
    _.each(args.views, (spec, name) => {
        // get list of model views
        var views = Array.isArray(spec) ? spec : [spec]
        // validate that all model views can be loaded
        _.each(views, view => requireValidModelView(view, args.views, true))
        // add to views
        this.views[name] = views
    })
}
8889
function (viewInstance) {
            console.assert(viewInstance instanceof Backbone.BaseView, 'viewInstance must be an instance of Backbone.BaseView');
            var mixins = slice.call(arguments, 1);
            _marinate(viewInstance, mixins);
        }
1200749
def generate_create_view(self):
        """"""

        name = model_class_form(self.model + 'CreateView')
        create_args = dict(
            form_class=self.get_actual_form('create'),
            model=self.get_model_class,
            template_name=self.get_template('create'),
            permissions=self.view_permission('create'),
            permission_required=self.check_permission_required,
            login_required=self.check_login_required,
            inlineformset=self.inlineformset,
            success_url=reverse_lazy('{}-{}-list'.format(self.app, self.custom_postfix_url)),
            custom_form=self.createupdate_forms or self.custom_modelform,
            custom_postfix_url=self.custom_postfix_url
        )

        parent_classes = [self.get_createupdate_mixin(), CreateView]
        if self.custom_create_view_mixin:
            parent_classes.insert(0, self.custom_create_view_mixin)

        create_class = type(
            name,
            tuple(parent_classes),
            create_args
        )

        self.classes[name] = create_class
        return create_class