Renders form language switcher.

@param \yii\base\Model $model
@param string $view
@return string
498262
public function languageSwitcher($model, $view = null)
    {
        $languages = ($model->getBehavior('multilingual')) ? $languages = $model->getBehavior('multilingual')->languages : [];
        
        return FormLanguageSwitcher::widget(['languages' => $languages, 'view' => $view]);
    }
65840
public function renderInput ($model, $attribute)
    {
        Html::addCssClass($this->chooseButtonClass, "btn {$this->_hashVar}");
        $eles = [];
        $eles[] = Html::activeTextInput($model, $attribute, ['class' => 'form-control']);
        $eles[] = Html::tag('span', Html::button('选择图片', $this->chooseButtonClass), ['class' => 'input-group-btn']);

        return Html::tag('div', implode("\n", $eles), ['class' => 'input-group']);
    }
124862
public function render(string $view): string
	{
		if(empty($this->viewFactory))
		{
			throw new RuntimeException('A [ ViewFactory ] instance is required to render pagination views.');
		}

		return $this->viewFactory->create($view, $this->pagination())->render();
	}
1292279
public function render(Model $model, $source)
    {
        $source = $this->resolveModelSource($model, $source);

        $date = $this->interpretAsDate($source);

        if ( ! $date) {
            return '';
        }

        return e($date->format($this->getFormat()));
    }
41582
protected function view( $view ) {
		if ( preg_match( '/\.\w+$/', $view, $matches ) && in_array( $matches[0], $this->extensions() ) ) {
			return str_replace( '.', '/', preg_replace( '/' . $matches[0] . '$/', '', $view ) ) . $matches[0];
		}

		return $this->extension( str_replace( '.', '/', $view ) );
	}
1306383
final public function partial(View $view) : string
    {
        if ($this->injector) {
            $this->injector->inject($view);
        }

        return $view->render();
    }
215183
public function compose(View $view)
    {
        $character_info = CharacterInfo::find($this->request->character_id);

        if (! is_null($character_info))
            $view->with('character_name', $character_info->name);

        $user = User::find($this->request->character_id);

        if (! isset($user->refresh_token)){
            $deleted_at = $user->refresh_token()->withTrashed()->first()->deleted_at;
            redirect()->back()->with('warning', trans('web::seat.deleted_refresh_token', ['time' => human_diff($deleted_at)]));
        }
    }
78435
public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $view->vars['translation'] = isset($options['translation']) && $options['translation'] === true;
        $view->vars['currentLocale'] = $this->defaultLocale;
        if($view->vars['translation']) {
            $parent = $form->getParent();
            if($parent instanceof Form) {
                $property = new Property($form->getPropertyPath());
                $entity = $parent->getConfig()->getDataClass();
                if(is_object($parent->getData())) {
                    $entity = $parent->getData();
                }

                $translations = $this->translator->getTranslationData($entity, $property);
                if($translations === null) {
                    $view->vars['translation'] = false;
                    return;
                }
                $view->vars['translations'] = $translations;
            }
        }
    }
632314
protected function render($view,$data)
	{
		$app=Yii::app();
		$isAjax=$app->getRequest()->getIsAjaxRequest();
		$isFlash=$app->getRequest()->getIsFlashRequest();

		if($this->showInFireBug)
		{
			// do not output anything for ajax and/or flash requests if needed
			if($isAjax && $this->ignoreAjaxInFireBug || $isFlash && $this->ignoreFlashInFireBug)
				return;
			$view.='-firebug';
			if(($userAgent=$app->getRequest()->getUserAgent())!==null && preg_match('/msie [5-9]/i',$userAgent))
			{
				echo '<script type="text/javascript">';
				echo file_get_contents(dirname(__FILE__).'/../vendors/console-normalizer/normalizeconsole.min.js');
				echo "</script>\n";
			}
		}
		elseif(!($app instanceof CWebApplication) || $isAjax || $isFlash)
			return;

		$viewFile=YII_PATH.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$view.'.php';
		include($app->findLocalizedFile($viewFile,'en'));
	}
1347516
public function compose(View $view)
    {
        $countries = Country::all();
        $options = Collection::make();
        foreach ($countries as $country) {
            $options->put($country->currency_code,['id' => $country->currency_code,'name' => $country->currency_code] );
        }
        $statusOptions = Collection::make([['id' => 'ENABLED','name' => 'Enabled'],['id' => 'DISABLED','name' => 'Disabled']]);
       
        $view->with('codeOptions', $options)
                    ->with('statusOptions',$statusOptions);
    }
249434
public function updateViewCss(View $view)
    {
        $view->changeCssHash();

        //Update css file
        $this->widgetMapBuilder->build($view, true);
        $widgets = $this->widgetRepo->findAllWidgetsForView($view);

        //Generate CSS file and set View's CSS as up to date
        $oldHash = $view->getCssHash();
        $view->changeCssHash();
        $this->viewCssBuilder->updateViewCss($oldHash, $view, $widgets);
        $view->setCssUpToDate(true);

        //Persist new hash and upToDate bool
        $metadata = $this->em->getClassMetadata(get_class($view));
        $this->uow->recomputeSingleEntityChangeSet($metadata, $view);
    }
1160171
public function renderInput($view)
    {
        // First check if there isn't a model view.

        $viewName = 'ignicms::admin.formElements.'.$view;

        if ($this->model instanceof AdminModel && $identifier = $this->model->getIdentifier()) {
            // First check if there is a rewrite on specific field type
            $field = str_slug($this->field);
            if (\View::exists('resources.'.$identifier.'.formElements.'.$field)) {
                $viewName = 'resources.'.$identifier.'.formElements.'.$field;
            } elseif (\View::exists('resources.'.$identifier.'.formElements.'.$view)) {
                $viewName = 'resources.'.$identifier.'.formElements.'.$view;
            }
        }

        return view($viewName, [
            'record' => $this->model,
            'fieldName' => $this->field,
            'elementName' => $this->elementName,
            'options' => $this->options,
            'sourceModel' => $this->sourceModel,
        ]);
    }
821616
protected function renderView(array $view)
    {
        foreach ($view as $key => $element) {
            if (empty($element['value'])) {
                $view[$key] = '';
                continue;
            }

            if (!empty($element['html'])) {
                $attributes = $this->renderAttributes($element['html_attributes']);
                $prefix = '<' . $element['html_tag'] . ' ' . $attributes . '>';
                $suffix = '</' . $element['html_tag'] . '>';
                $value = htmlspecialchars($element['value'], ENT_QUOTES, 'UTF-8');
                $view[$key] = $prefix . $value . $suffix;
            } else {
                $view[$key] = strip_tags($element['value']);
            }
        }

        return $view;
    }
1082282
public function routeToViewModelTranslation($key, $model)
    {
        if ($translation = $model->translations->get($key)) {
            return $this->currentUrl('view/'.$translation->id);
        }
    }
1069283
protected function Render($view="",$format = null)
	{
		$isSmarty = (strpos(get_class($this->RenderEngine),"Smarty") > -1);

		if ($isSmarty && $format == null) $format = self::$SmartyViewPrefix;

		if ($format == null) $format = '';

		if ($view == "")
		{
			// automatic binding
			$backtrace = debug_backtrace();
			$view = str_replace("Controller","", $backtrace[1]['class']) . $backtrace[1]['function'];
		}

		// if the render engine is Smarty then add the '.tpl' suffix
		$viewPath = $isSmarty ? $format.$view.".tpl" : $format.$view;

		// capture output instead of rendering if specified
		if ($this->CaptureOutputMode)
		{
			$this->DebugOutput = $this->RenderEngine->fetch($viewPath);
		}
		else
		{
			$this->RenderEngine->display($viewPath);
		}
	}
344742
public function actionEdit($id)
    {
        $model = $this->findModel($id);
        $form  = new LanguageForm($model);
        if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())){
            if (!$errors = ActiveForm::validate($form)) {
                try {
                    $this->service->edit($form->id, $form);
                    $this->output['status'] = 1;
                } catch (YiiException $e) {
                    $errors = ErrorHelper::checkModel($e->data, $form);
                }
            }
            return $this->output['errors'] = $errors;
        }
        return $this->render('edit', ['model' => $form]);
    }
805973
protected function renderHelp(Model $model)
    {
        $data = $model->getJson();

        // Test if we have anything to display at all.
        if (empty($data) === true) {
            return '';
        }

        // We have at least something to display here.
        $helpRow = $this->getTemplateFileContent(static::FILE_HELPROW);
        $helpContent = '';

        // Add the stuff from the json after the help text, if any.
        foreach ($data as $title => $text) {
            $helpContent .= str_replace(
                array(static::MARKER_HELP_TITLE, static::MARKER_HELP_TEXT),
                array($title, $text),
                $helpRow
            );
        }

        // Add it into the wrapper.
        return str_replace(static::MARKER_HELP, $helpContent, $this->getTemplateFileContent(static::FILE_HELP));
    }