    <?= CHtml::errorSummary($form, null, null, array('class' => 'error_my')); ?>

    <?php
    if (Yii::app()->user->hasFlash('news_added') OR Yii::app()->user->hasFlash('news_edit')):
        if (Yii::app()->user->hasFlash('news_added')) {
            echo Yii::app()->user->getFlash('news_added');
        }
        if (Yii::app()->user->hasFlash('news_edit')) {
            echo Yii::app()->user->getFlash('news_edit');
        }
        ?> 
    <?php else: ?>
        <?= CHtml::beginForm(); ?>
        <?= CHtml::activeLabel($form, 'title'); ?>

        <?= CHtml::activeTextField($form, 'title', array('value' => $model['title'])); ?>

        <?= CHtml::activeLabel($form, 'text'); ?>

        <?= CHtml::activeTextArea($form, 'text', array('rows' => '10', 'cols' => '30', 'value' => $model['text'])); ?>

        <?= CHtml::activeLabel($form, 'author'); ?>

        <?= CHtml::activeTextField($form, 'author', array('value' => Yii::app()->user->login)); ?>
        <br />
        <?= CHtml::submitButton('Сохранить', array('class' => 'button')) ?>
        <?= CHtml::endForm(); ?>
    <?php endif; ?> 

