chinese-journal/yii/protected/views/site/addPost.php

49 lines
1.5 KiB
PHP

<?php
/* @var $this AddPostFormController */
/* @var $model AddPostForm */
/* @var $form CActiveForm */
$this->pageTitle=Yii::t('app', Yii::app()->name) . ' - ' . Yii::t('app', 'Add post');
?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'add-post-form-addPost-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// See class documentation of CActiveForm for details on this,
// you need to use the performAjaxValidation()-method described there.
'enableAjaxValidation'=>false,
'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>
<p class="note"><?=Yii::t('app', 'Fields with {*} are required.', array('{*}'=>'<span class="required">*</span>'))?></p>
<?php echo $form->errorSummary($model, Yii::t('app', 'Please, fix following errors:')); ?>
<div class="row">
<?php echo $form->labelEx($model,'title'); ?>
<?php echo $form->textField($model,'title'); ?>
<?php echo $form->error($model,'title'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'text'); ?>
<?php echo $form->textArea($model,'text'); ?>
<?php echo $form->error($model,'text'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'image'); ?>
<?php echo $form->fileField($model,'image'); ?>
<?php echo $form->error($model,'image'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton(Yii::t('app', 'Send')); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->