Create views for a controller
552105
function () {
                    var content = ctrl.view;
                    var header  = noHeader ? null : new Jackbone.DefaultHeader();
                    var footer  = noFooter ? null : new Jackbone.DefaultFooter();
                    var view    = new JQMView(header, content, footer);

                    // Cache the controller
                    that.controllers[pageUID] = { pageUID: pageUID, controller: ctrl };
                    ctrl._rootView = view;
                    view.controller = ctrl;

                    doneCreate();
                }
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;
	}
1088486
private function generateController()
    {
        // Generate Controller class
        $controllerInstance = Controller::instance($this->columns, $this->viewType, $this);

        $controllerTemplateDir =
            dirname(dirname(__FILE__)).DS.'src'.DS.'Apps'.DS.'Controllers'.DS;

        $controllerInstance->setControllerTemplatePath($controllerTemplateDir);
        $controllerInstance->setApplicationDirectory($this->applicationDir);

        $controllerInstance->setControllerName($this->controller);
        $controllerInstance->setModelName($this->model);
        $controllerInstance->updateTemplate();
        $controllerInstance->generateControllerTemplate();

        $controllerInstance->generate();

        $this->info("Controller $this->controller Generated Successfully!");
    }
196019
public function getView()
    {
        if (is_null($this->_view)) {
            $controller = $this->_routeInfo->controllerName;
            $name = $this->_routeInfo->action;
            $ext = $this->_routeInfo->getExtension();
            $template = "{$controller}/{$name}.{$ext}.twig";
            if (!is_null($this->_controller->view)) {
                $template = "{$this->_controller->view}.{$ext}.twig";
            }
            $this->_view = new View(['file' => $template]);
        }
        return $this->_view;
    }
673477
public function create()
    {
        $this->viewData['record'] = $this->model;

        $this->viewData['actionVerb'] = 'Create';
        $this->viewData['formMethod'] = 'POST';
        $this->viewData['formAction'] = 'user.store';

        return view($this->defaultFormView, $this->viewData);
    }
135840
public static function factory($view, Controller $section)
	{
		// Ensure specified view exists
		if(class_exists($view))
		{
			// Create the view with the section as its parameter
			try
			{
				return new $view($section);
			}
			catch(\Exception $ex)
			{
				trigger_error("Could not load View '$view'.");
			}
		}
		else
		{
			// Throw an exception
			throw new \Exception("Specified view '$view' does not exist.");
		}
		
	}
1130899
def view_for(self, action='view'):
        
        app = current_app._get_current_object()
        view, attr = self.view_for_endpoints[app][action]
        return getattr(view(self), attr)
442449
public function view($___view, $___variables = null, $___realpath = false)
    {
        $___file = BASEPATH.'/App/Views/' . ($___realpath ? $___view : $___view . '.tpl.php');
        if (!file_exists($___file)) {
            throw new \Exception("View not found ! File : {$___view}", 400);
        }
        if (is_array($___variables)) {
            foreach ($___variables as $___key => $___value) {
                $$___key = $___value;
            }
        }
        unset($___variables, $___key, $___value, $___realpath, $___view);
        include $___file;
    }
563551
def render_with_scope(scope = nil, action = self.action_name, path = self.controller_path)
        templates = [ [path, action] ]
        templates << [path, scope, action] if scope
        
        if Sunrise::Config.scoped_views?
          templates << [path, abstract_model.plural, scope, action]
        end
        
        templates.reverse.each do |keys|
          name = File.join(*keys.compact.map(&:to_s))
          return render(:template => name) if template_exists?(name)
        end
      end
1360790
public function actionView()
    {
        $data = [
            'f1' => $this->getContext()->getInput()->get('p1'),
            'f2' => $this->getContext()->getInput()->get('p2'),
            'f3' => $this->getContext()->getInput()->get('id'),
        ];
        $this->outputJson($data);
    }
700914
function (oView) {
				var oController = oView.getController();

				// Add the sub view to the current one
				this._oContainerPage.addContent(oView);
				this._oContainerPage.setBusy(false);

				// Init the sub view and controller with the needed references.The view's are nested and work in a
				// mimic way so they need to share some references.
				oController.initiate({
					sTopicId: this._sTopicid,
					oModel: this._oModel,
					aApiIndex: this._aApiIndex,
					aAllowedMembers: this._aAllowedMembers,
					oEntityData: this._oEntityData,
					sEntityType: this._sEntityType,
					sEntityId: this._sEntityId,
					oOwnerComponent: this.getOwnerComponent(),
					oContainerView: this.getView(),
					oContainerController: this
				});
			}
155234
function renderSideview(appName, initialModel, routeInfo) {

    if ( !routeInfo.hasSideview ) {
        return new Q('');
    }

    var sideviewName = routeInfo.sideview || 'default';
    var sideview = this.pancakes.cook('app/' + appName + '/partials/' + appName +
                                        '.sideview.' + sideviewName + '.partial');
    var me = this;

    var user = initialModel && initialModel.user;
    var activeUser = user ? {
        _id: user._id,
        name: user.username,
        role: user.role,
        user: user
    } : {};

    var modelDeps = {
        currentScope:   sideview.defaults || {},
        initialModel:   initialModel,
        routeInfo:      routeInfo,
        activeUser:     activeUser
    };

    // call the sideview model allowing it to make another database call
    return Q.when(this.pancakes.cook(sideview.model, { dependencies: modelDeps }))
        .then(function (model) {

            // this is similar to both jng.pages renderPage() and jng.directives
            // as well as ng.uipart.template (for client side pages and partials)
            me.attachToScope(model, sideview.attachToScope);

            // generate the partial view
            var viewDeps = { model: model, subviews: me.getSubviews(sideview.subviews) };
            _.extend(viewDeps, me.getJangularDeps());
            var view = me.pancakes.cook(sideview.view, { dependencies: viewDeps });
            return jangular.render(view, model, { strip: routeInfo.strip });
        });
}
91110
function View() {
        Element.apply(this, arguments);

        /** @member {Model} */
        this.model = null;

        /** @member {Array.<View>} */
        this.subViews = [];

        /** @member {View} */
        this.containerView = null;

        /** @member {Array.<View>} */
        this.containedViews = [];

        /** @member {boolean} */
        this.visible = true;

        /** @member {boolean} */
        this.enabled = true;

        /** @member {boolean} */
        this.selected = false;

        /** @member {number} */
        this.selectable = SK_YES;

        /** @member {string} */
        this.lineColor = PreferenceManager.get("view.lineColor", "#000000");

        /** @member {string} */
        this.fillColor = PreferenceManager.get("view.fillColor", "#ffffff");

        /** @member {string} */
        this.fontColor = PreferenceManager.get("view.fontColor", "#000000");

        /** @member {Font} */
        this.font = new Font(
            PreferenceManager.get("view.font", "Arial"),
            PreferenceManager.get("view.fontSize", 13),
            Graphics.FS_NORMAL
        );

        /** @member {boolean} */
        this.parentStyle = false;

        /** @member {boolean} */
        this.showShadow = PreferenceManager.get("view.showShadow", true);

        /** @member {boolean} */
        this.containerChangeable = false;

        /** @member {boolean} */
        this.containerExtending = false;

        /** @member {number} */
        this.zIndex = 0;
    }
1127348
def view_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/views.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
861261
protected function createView()
    {
        if ($this->files->exists($path = $this->getViewPath())) {
            $this->error('View already exists!');

            return;
        }

        $this->makeDirectory($path);
        $view = $this->files->get($this->getViewStub('view'));
        $this->files->put($path, $view);

        $form = $this->files->get($this->getViewStub('form'));
        $this->files->put($this->getViewPath('_form'), $form);

        $this->info('Views successfully created.');
    }
1209433
protected function generateViews()
    {
        $viewsDir = app_path().'/views';
        $container = $viewsDir . '/' . Pluralizer::plural($this->model);
        $layouts = $viewsDir . '/layouts';
        $views = array('index', 'show', 'create', 'edit');

        $this->generator->folders(
            array($container)
        );

        // If generating a scaffold, we also need views/layouts/scaffold
        if (get_called_class() === 'Fly\\Generators\\Commands\\ScaffoldGeneratorCommand')
        {
            $views[] = 'scaffold';
            $this->generator->folders($layouts);
        }

        // Let's filter through all of our needed views
        // and create each one.
        foreach($views as $view)
        {
            $path = $view === 'scaffold' ? $layouts : $container;
            $this->generateView($view, $path);
        }
    }
704465
function addRenderController() {
    var modifier = new Modifier({
        size: [200, 200],
        transform: Transform.translate(400, 0)
    });

    var controller = new RenderController();

    var index = 0;
    var items = [];

    function getItem(i) {
        var surface = new Surface({
            content: 'View ' + i,
            properties: {
                backgroundColor: getRandomColor(),
                color: 'white',
                lineHeight: '200px',
                textAlign: 'center',
                fontSize: '30px',
                cursor: 'pointer'
            }
        });

        surface.on('click', function() {
            index = (index + 1) % items.length;
            controller.show(items[index]);
        });

        return surface;
    }

    for (var i = 0; i < 4; i++) {
        items.push(getItem(i));
    }

    controller.show(items[index]);
    ctx.add(modifier).add(controller);
}