Yii2:为什么在模块中渲染页面时setFlash不起作用?

I've an application using Yii2, basic template. In my app, I'm using Yii::$app->session-setFlash for show a message when render a page.

When I place my application in app, it work well. But when I move the app into module, it didn't show a message. The module called school

This is the code I've using for showing message and render page in my app/module/school

Yii::$app->session->setFlash('error', "Error!");
return Yii::$app->response->redirect(['school/student/create']);

the page successfully return to school/student/create page, but didn't show the message.

and this the code when I place the app in app

Yii::$app->session->setFlash('error', "Error!");
return Yii::$app->response->redirect(['create']);

the code above successfully return to page student/create and show the message.

This is my app directory structure:

--school
  --assets
  --commands
  --config 
  --controllers
  --file
  --mail
  --models
  --modules         //this the module
    --school
      --controllers
      --models
      --search
      --views
      --Module.php
  --runtime
  --test
  --vendor
  --views
  --web
  .....

Anyone know why It happen? and How do I can solve this?

Anyhelp will be appreciated, thanks :)

Edited:

This is code:

app/modules/school/views/student/_form.php

<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\file\FileInput;

/* @var $this yii\web\View */
/* @var $model backend\models\Student */
/* @var $form yii\widgets\ActiveForm */
?>

<script type="text/javascript" src="../../web/js/jquery-1.5.2.min.js">                </script>

<div class="student-form">

<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
<?=
$form->field($model, 'file')->widget(FileInput::classname(), [
    'options' => [
        'accept' => 'doc/*', 'file/*',

    ],
    'pluginOptions' => [
        'allowedFileExtensions' => ['csv', 'xls', 'xlsx'],
        'showUpload' => FALSE,
        'showPreview' => FALSE,
    ]
]);
?>
<?= Html::submitButton('<i class="glyphicon glyphicon-save-file"></i> UPLOAD', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary'], ['fakturout/create']) ?>
<?php ActiveForm::end(); ?>

</div>

and

app/modules/school/view/student/create.php

<?php
use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model backend\models\Student */

$this->title = 'Student';
?>

<div class="title">
<?= Html::encode($this->title) ?>

</div>
<?=
  $this->render('_form', [
  'model' => $model,
])
?>

You have no line of code to render your session flash messages in the module. To test it add following code in the app/modules/school/view/student/create.php:

    <?php
    use yii\helpers\Html;

    /* @var $this yii\web\View */
    /* @var $model backend\models\Student */

    $this->title = 'Student';
    ?>

    <?php if (Yii::$app->session->hasFlash('success')): ?>
        <div class="alert alert-success">
            <?= Yii::$app->session->getFlash('success'); ?>
        </div>
    <?php endif; ?>
    <?php if (Yii::$app->session->hasFlash('warning')): ?>
        <div class="alert alert-warning">
            <?= Yii::$app->session->getFlash('warning'); ?>
        </div>
    <?php endif; ?>

    <?php if (Yii::$app->session->hasFlash('error')): ?>
        <div class="alert alert-danger">
            <?= Yii::$app->session->getFlash('error'); ?>
        </div>
    <?php endif; ?>

    <div class="title">
    <?= Html::encode($this->title) ?>

    </div>
    <?=
      $this->render('_form', [
      'model' => $model,
    ])
    ?>

I recommend add following code at the widget and render widget in your layout template (app/views/layouts/main.php), or add in layout template without widget:

<?php if (Yii::$app->session->hasFlash('success')): ?>
    <div class="alert alert-success">
        <?= Yii::$app->session->getFlash('success'); ?>
    </div>
<?php endif; ?>
<?php if (Yii::$app->session->hasFlash('warning')): ?>
    <div class="alert alert-warning">
        <?= Yii::$app->session->getFlash('warning'); ?>
    </div>
<?php endif; ?>
<?php if (Yii::$app->session->hasFlash('error')): ?>
    <div class="alert alert-danger">
        <?= Yii::$app->session->getFlash('error'); ?>
    </div>
<?php endif; ?>