答案 0 :(得分:1)
您可以使用此代码解决方案。检查下面的消息代码集。
<强> view.php 强>
<div class="ibox">
<div class="ibox-heading">
<div class="ibox-title">
<h3><?PHP echo(($model->isNewRecord) ? 'Create Fee Structure' : 'Update Fee Structure'); ?></h3>
</div>
</div>
<!-- /.box-header -->
<!-- Set Message start -->
<?php if(Yii::app()->user->hasFlash('confirm')):?>
<div class="info">
<?php echo Yii::app()->user->getFlash('confirm'); ?>
</div>
<?php endif; ?>
<!-- Message end -->
<!-- form start -->
<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'fee_structure_form',
'enableAjaxValidation' => true,
'htmlOptions' => array(
'enctype' => 'multipart/form-data',
'role' => 'form'
),
'clientOptions' => array(
'validateOnSubmit' => true,
'validateOnChange' => true,
'validateOnType' => false,
),
)); ?>
<div class="ibox-content">
<div class="row">
<div class="col-md-6 col-xs-12">
<div class="form-group">
<?PHP
echo $form->label($model, 'class_id');
echo $form->dropDownList($model, 'class_id', $studentClasses,array('placeholder' => 'Class', 'class' => 'form-control'));
echo $form->error($model,'class_id');
?>
</div>
<div class="form-group">
<?PHP
echo $form->label($model, 'fee_type');
echo $form->dropDownList($model, 'fee_type', $feeTypes, array('placeholder' => 'Fee Type', 'class' => 'form-control'));
echo $form->error($model,'fee_type');
?>
</div>
<div class="form-group">
<?PHP
echo $form->label($model, 'amount');
echo $form->textField($model, 'amount', array('placeholder' => 'Amount', 'class' => 'form-control'));
echo $form->error($model,'amount');
?>
</div>
<div class="form-group">
<?PHP
echo $form->label($model, 'remarks');
echo $form->textField($model, 'remarks', array('placeholder' => 'Remarks', 'class' => 'form-control'));
echo $form->error($model,'remarks');
?>
</div>
</div>
</div>
</div>
<div class="ibox-footer col-md-12 col-xs-12" style="margin-bottom: 60px;">
<button class="btn col-md-3 col-xs-12 btn-primary pull-left" type="submit">
<?PHP echo Definations::SAVEFORM; ?>
</button>
</div>
<?PHP
$this->endWidget();
?>
</div>