コード例 #1
0
    public function actionIndex()
    {
        if(!Auction::$app->user->isGuest){
            $this->redirect($this->goHome());
        }

        $model = new CompanyRegistration();

        if ($model->load(Auction::$app->request->post()) && $model->save()) {
                Auction::$app->session->setFlash('success', 'Thank you ');

            return $this->refresh();
        }

        return $this->render('//company/registration', [
            'model' => $model,
        ]);
    }
コード例 #2
0
    public function actionIndex(){

        $model= new CompanyRegistration();

        if(Auction::$app->request->isPost){

            $model->load(Auction::$app->request->post());
            $model->SaveCompany();

        }
        else {

            $modelAttributes = ArrayHelper::merge($this->loadModel()->getAttributes(), $this->loadModel()->company->attributes);
            $model->setAttributes($modelAttributes);

        }

        return $this->render('//company/edit',['model' => $model]);

    }