src/actions/Action.php
public function addFlash($type, $error = null)
    {
        if ($type === 'error' && is_string($error) && !empty($error)) {
            $text = Yii::t('hipanel', $error);
        } else {
            $text = $this->getFlashText($type);
        }

        if ($type instanceof Closure) {
            $text = call_user_func($text, $text, $this);
        }

        Yii::$app->session->addFlash($type, [
            'text' => $text,
        ]);
    }
public function addFlash($type, $error = null)
    {
        if ($type === 'error' && is_string($error) && !empty($error)) {
            $text = Yii::t('hipanel', $error);
        } else {
            $text = $this->getFlashText($type);
        }

        if ($type instanceof Closure) {
            $text = call_user_func($text, $text, $this);
        }

        Yii::$app->session->addFlash($type, [
            'text' => $text,
        ]);
    }
public function addFlash ( $ type , $ error = null ) { if ( $ type === 'error' && is_string ( $ error ) && ! empty ( $ error ) ) { $ text = Yii :: t ( 'hipanel' , $ error ) ; } else { $ text = $ this -> getFlashText ( $ type ) ; } if ( $ type instanceof Closure ) { $ text = call_user_func ( $ text , $ text , $ this ) ; } Yii :: $ app -> session -> addFlash ( $ type , [ 'text' => $ text , ] ) ; }
Adds flash message.

@param string $type the type of flash
@param string $error the text of error
Adds flash message .