Submittbutton seems to be 'dead'

Hi guys, following code won’t save records into database as Yii::$app->request->post() always will be an empty array, unless, if submitButton has been pushed or not. Why? What is wrong with this code?
Controller:

public function actionConclusion($id, $laenderkennung, $kontonummer, $blz, $institut, $bic, $iban) {
    $model = new Bankverbindung();
    if (Yii::$app->request->post()) { //will never be entered.Why??
        print_r('Request succesfully send!');
        die();
        $model->laenderkennung = $laenderkennung;
        $model->institut = $institut;
        $model->blz = $blz;
        $model->kontoNr = $kontonummer;
        $model->iban = $iban;
        $model->bic = $bic;
        $model->save();
        $this->redirect(['/bankverbindung/index']);
    } else {
        print_r('<br><br>');
        var_dump(Yii::$app->request->post()); //will always be an empty array. Why??
        return $this->render('_form_conclusion', [
                    'id' => $id,
                    'laenderkennung' => $laenderkennung,
                    'kontonummer' => $kontonummer,
                    'blz' => $blz,
                    'institut' => $institut,
                    'bic' => $bic,
                    'iban' => $iban
        ]);
    }
}

View:

<?php

use yii\helpers\Html;
use kartik\form\ActiveForm;

ActiveForm::begin([
    'id' => 'dynamic-form',
    'type' => ActiveForm::TYPE_VERTICAL,
    'formConfig' => [
        'showLabels' => false
]]);
$this->title = Yii::t('app', 'Zusammenfassung');
?>
<div class="page-header">
    <br><br><center>
        <h1><?= Html::encode($this->title) ?></h1></center>
</div>
<div class="jumbotron">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <p>Folgende Bankdaten werden nach Ihrem Submit abgespeichert:</p>
            </div>
            <div class="col-md-4">
                <p>Länderkennung: <?= $laenderkennung ?></p>
            </div>
            <div class="col-md-4">
                <p>Kontonummer: <?= $kontonummer ?></p>
            </div>
            <div class="col-md-4">
                <p>Bankleitzahl: <?= $blz ?></p>
            </div>
            <div class="col-md-4">
                <p>Institut: <?= $institut ?></p>
            </div>  
            <div class="col-md-4">
                <p>BIC: <?= $bic ?></p>
            </div>         
            <div class="col-md-4">
                <p>IBAN: <?= $iban ?></p>
            </div>  
        </div>
    </div>
</div>
<div class="form-group"> 
    //this Submittbutton seems to be dead.Why??            
    <?= Html::submitButton(Yii::t('app', 'Weiter'), ['class' => 'btn btn-info']) ?>
    <?= Html::a(Yii::t('app', 'Cancel'), ['/site/index'], ['class' => 'btn btn-danger']) ?>
</div>
<?php ActiveForm::end(); ?>

Problem solved after having reeinstalled whole application from repositorie using SmartGit and composer. I never will find out what 'caused this error as code still will be the same :=(

1 Like