Viewlets allow through-the-web customizations.

        Through-the-web customization magic is managed by five.customerize.
        We need to think of this when looking up viewlets.

        @return: Viewlet registration object
777215
def getViewletByName(self, name):

        
        views = registration.getViews(IBrowserRequest)

        for v in views:

            if v.provided == IViewlet:
                # Note that we might have conflicting BrowserView with the same
                # name, thus we need to check for provided
                if v.name == name:
                    return v

        return None
443043
public function create()
	{
		$view = $this->getView();
		$siteid = $this->getContext()->getLocale()->getSiteId();
		$data = $view->param( 'property', [] );

		foreach( $data as $idx => $entry ) {
			$data[$idx]['customer.lists.siteid'] = $siteid;
		}

		$view->propertyTypes = $this->getPropertyTypes();
		$view->propertyData = $data;
		$view->propertyBody = '';

		foreach( $this->getSubClients() as $client ) {
			$view->propertyBody .= $client->create();
		}

		return $this->render( $view );
	}
1013805
def get_context_data(self, **kwargs):
        '''  '''

        # Update the site session data so that registration processes know to send return links to
        # the view class registrations page.  set_return_page() is in SiteHistoryMixin.
        self.set_return_page('viewregistrations',_('View Registrations'),event_id=self.object.id)

        context = {
            'event': self.object,
            'registrations': EventRegistration.objects.filter(
                event=self.object,
                cancelled=False
            ).order_by('registration__customer__user__first_name', 'registration__customer__user__last_name'),
        }
        context.update(kwargs)
        return super(EventRegistrationSummaryView, self).get_context_data(**context)
583060
public static function isHtmlView()
    {
        if (self::$_isHtmlView === NULL) {
            self::$_isHtmlView = false;

            $view = Registry::get('view');
            if ($view === NULL) {
                $template = ViewAbstract::getTemplateConfig();
                if (is_array($template)
                    and isset($template['type'])
                    and $template['type'] === ViewInterface::TYPE_HTML) {
                    self::$_isHtmlView = true;
                }
            } else if ($view instanceof View and $view->getType() == ViewInterface::TYPE_HTML) {
                self::$_isHtmlView = true;
            }
        }

        return self::$_isHtmlView;
    }
1150624
function docletModel(doclet) {
  return function(context, cb) {
    logger.debug('doclet', doclet);
    var viewModel = _.extend({},
      util.rstMixin,
      util.docletChildren(context, doclet, util.mainDocletKinds),
      // (doclet.kind === 'module' ? {} :
      //   util.docletChildren(context, doclet, util.subDocletKinds)
      // ), {
      util.docletChildren(context, doclet, util.subDocletKinds), {
        doclet: doclet,
        example: util.example
      }
    );
    util.view('doclet.rst', viewModel, cb);
  };
}
268501
def dispatch(self, *args, **kwargs):
        
        if not self.registration_allowed():
            return HttpResponseRedirect(force_text(self.disallowed_url))
        return super(RegistrationView, self).dispatch(*args, **kwargs)
49990
public function getAvailableHtmlHeadEntrySet()
    {
        $set = parent::getAvailableHtmlHeadEntrySet();

        foreach ($this->action_items as $child_widget) {
            $set->addEntrySet($child_widget->getAvailableHtmlHeadEntrySet());
        }

        return $set;
    }
761066
private function clientRenderList()
    {
        if ($this->settings['useGroups'])
        {
            $view = new Gallery_ClientGroupedListView();
        }
        else
        {
            $view = new Gallery_ClientListView();
        }

        $html = $view->render();
        return $html;
    }
553528
function() {
			var sTriggerID = this._oControl.getId() + "-trigger",
				sTriggerText = this._oControl.getGrowingTriggerText();

			sTriggerText = sTriggerText || sap.ui.getCore().getLibraryResourceBundle("sap.m").getText("LOAD_MORE_DATA");
			this._oControl.addNavSection(sTriggerID);

			if (this._oTrigger) {
				this.setTriggerText(sTriggerText);
				return this._oTrigger;
			}

			// The growing button is changed to span tag as h1 tag was semantically incorrect.
			this._oTrigger = new CustomListItem({
				id: sTriggerID,
				busyIndicatorDelay: 0,
				type: ListType.Active,
				content: new HTML({
					content:	'<div class="sapMGrowingListTrigger">' +
									'<div class="sapMSLITitleDiv sapMGrowingListTriggerText">' +
										'<span class="sapMSLITitle" id="' + sTriggerID + 'Text">' + encodeXML(sTriggerText) + '</span>' +
									'</div>' +
									'<div class="sapMGrowingListDescription sapMSLIDescription" id="' + sTriggerID + 'Info"></div>' +
								'</div>'
				})
			}).setParent(this._oControl, null, true).attachPress(this.requestNewPage, this).addEventDelegate({
				onsapenter : function(oEvent) {
					this.requestNewPage();
					oEvent.preventDefault();
				},
				onsapspace : function(oEvent) {
					this.requestNewPage();
					oEvent.preventDefault();
				},
				onAfterRendering : function(oEvent) {
					this._oTrigger.$().attr({
						"tabindex": 0,
						"role": "button",
						"aria-labelledby": sTriggerID + "Text" + " " + sTriggerID + "Info"
					});
				}
			}, this);

			// stop the eventing between item and the list
			this._oTrigger.getList = function() {};
			// defines the tag name
			this._oTrigger.TagName = "div";

			return this._oTrigger;
		}
1082526
function() {
            var self = this;

            this.template = this.options.template;
            this.args = this.options.args || {};

            // Related view
            this.view = this.options.view || null;

            // Init template context
            _.extend(this.args, {
                "_": _,
                "hr": {
                    "configs": configs,
                    "urls": Urls,
                    "i18n": I18n,
                    "offline": Offline
                },
                "view": {
                    "component": function(cid, args, name, subid) {
                        name = name || cid;

                        if (!self.view) {
                            throw new Error("Error in template " + self.template + " : try to import component in a non view-related template ");
                        }

                        if (Template.components[cid] == null) {
                            throw new Error("Error in template " + self.template + " : try to import component "+cid);
                        }

                        var view = new Template.components[cid].Class(args || {}, self.view);
                        
                        self.view.addComponent(name, view);

                        var component = $("<component/>", {
                            "data-component": view.cid
                        });

                        return component[0].outerHTML;
                    }
                },
                "template": {
                    "args": this.args,
                    "name": this.template,
                    "import": function(name, args, cname) {
                        cname = cname || name;
                        return this.args.view.component("template", {template: name, args: args}, cname);
                    },
                    "htmlid": function(h) {
                        return _.escape(h);
                    }
                }
            }, Template.options);

            return this;
        }
452898
def register_calculator_view(request):
    """"""
    if request.method == "POST":
        form = CalculatorRegistrationForm(request.POST)
        logger.debug(form)
        if form.is_valid():
            obj = form.save()
            obj.user = request.user
            obj.save()
            messages.success(request, "Successfully added calculator.")
            return redirect("itemreg")
        else:
            messages.error(request, "Error adding calculator.")
    else:
        form = CalculatorRegistrationForm()
    return render(request, "itemreg/register_form.html", {"form": form, "action": "add", "type": "calculator", "form_route": "itemreg_calculator"})
576619
public function actionRegister() {
    if (!$this->module->enableRegistration) {
      throw new NotFoundHttpException();
    }

    /** @var RegistrationForm $model */
    $model = Yii::createObject(RegistrationForm::className());
    $event = $this->getFormEvent($model);

    $this->trigger(self::EVENT_BEFORE_REGISTER, $event);

    $this->performAjaxValidation($model);

    if ($model->load(Yii::$app->request->post()) && $model->register()) {

      $this->trigger(self::EVENT_AFTER_REGISTER, $event);

      return $this->render('/message', [
        'title' => Yii::t('users', 'Your account has been created'),
        'module' => $this->module,
      ]);
    }

    return $this->render('register', [
      'model' => $model,
      'module' => $this->module,
    ]);
  }
422275
public PropertyEditorRegistry getPropertyEditorRegistry() {
        final HttpServletRequest servletRequest = getCurrentRequest();
        PropertyEditorRegistry registry = (PropertyEditorRegistry) servletRequest.getAttribute(GrailsApplicationAttributes.PROPERTY_REGISTRY);
        if (registry == null) {
            registry = new PropertyEditorRegistrySupport();
            PropertyEditorRegistryUtils.registerCustomEditors(this, registry, RequestContextUtils.getLocale(servletRequest));
            servletRequest.setAttribute(GrailsApplicationAttributes.PROPERTY_REGISTRY, registry);
        }
        return registry;
    }
991283
public function doItBaby()
    {

        if (
        	EnvironmentLabel::$plugin->getSettings()->showLabel
			&& Craft::$app->getRequest()->isCpRequest
			&& Craft::$app->getUser()->getIdentity()
		) {
			$view = Craft::$app->getView();
			$view->registerCss($this->getCss());
			$view->registerCss("{$this->getTargetSelector()} { content: '{$this->getRenderedText()}'; }");
			$view->registerJs($this->getJs());
        }

    }
611469
def consumer_create
      content_view_environment = find_content_view_environment
      host = Katello::Host::SubscriptionFacet.find_or_create_host(content_view_environment.environment.organization, rhsm_params)

      Katello::RegistrationManager.register_host(host, rhsm_params, content_view_environment)
      host.reload

      update_host_registered_through(host, request.headers)

      render :json => Resources::Candlepin::Consumer.get(host.subscription_facet.uuid)
    end
1001270
public function registerClientScript() {
		
        $booster = Booster::getBooster();
        $booster->registerPackage('markdown');
        
        $id = $this->htmlOptions['id'];
        $options = CJSON::encode($this->options);
        
		Yii::app()->clientScript->registerScript(__CLASS__ . '#' . $id, "
			$('#$id').markdown({$options})
			", CClientScript::POS_END
		);
	}
1061068
public function registerJs()
    {
        if (!isset($this->clientOptions['create']) && empty($this->items)) {
            $this->clientOptions['create'] = "function(input) { return { value: input, text: input };}";
        }
        $clientOptions = (count($this->clientOptions)) ? Json::encode($this->clientOptions) : '';
        $this->getView()->registerJs("jQuery('#{$this->options['id']}').selectize({$clientOptions});");
    }