protected function renderForm($form, $view)
    {
        $errors = [];
        if(Yii::$app->request->isPost) {
            $form->load(Yii::$app->request->post());
            if(!$form->save()) {
                $errors = $form->getErrors();
            }

            return $this->redirect('list');
        }

        $currentLanguage = [
            $form->languageId => $this->_languageProvider->getNameByID($form->languageId)
        ];

        return $this->render($view, [
            'model' => $form,
            'errors' => $errors,
            'currentLanguage' => $currentLanguage
        ]);
    }
protected function renderForm($form, $view)
    {
        $errors = [];
        if(Yii::$app->request->isPost) {
            $form->load(Yii::$app->request->post());
            if(!$form->save()) {
                $errors = $form->getErrors();
            }

            return $this->redirect('list');
        }

        $currentLanguage = [
            $form->languageId => $this->_languageProvider->getNameByID($form->languageId)
        ];

        return $this->render($view, [
            'model' => $form,
            'errors' => $errors,
            'currentLanguage' => $currentLanguage
        ]);
    }
protected function renderForm ( $ form , $ view ) { $ errors = [ ] ; if ( Yii :: $ app -> request -> isPost ) { $ form -> load ( Yii :: $ app -> request -> post ( ) ) ; if ( ! $ form -> save ( ) ) { $ errors = $ form -> getErrors ( ) ; } return $ this -> redirect ( 'list' ) ; } $ currentLanguage = [ $ form -> languageId => $ this -> _languageProvider -> getNameByID ( $ form -> languageId ) ] ; return $ this -> render ( $ view , [ 'model' => $ form , 'errors' => $ errors , 'currentLanguage' => $ currentLanguage ] ) ; }
Method for rendering form for create and edit of template

@param TemplateForm $form
@param string $view
@return string
Method for rendering form for create and edit of template