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

49 lines
1.5 KiB
PHP
Raw Permalink Normal View History

2014-11-21 08:26:20 +00:00
<?php
/* @var $this AddPostFormController */
/* @var $model AddPostForm */
/* @var $form CActiveForm */
2014-11-22 13:14:22 +00:00
$this->pageTitle=Yii::t('app', Yii::app()->name) . ' - ' . Yii::t('app', 'Add post');
2014-11-21 08:26:20 +00:00
?>
<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'),
)); ?>
2014-11-22 13:14:22 +00:00
<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:')); ?>
2014-11-21 08:26:20 +00:00
<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">
2014-11-22 13:14:22 +00:00
<?php echo CHtml::submitButton(Yii::t('app', 'Send')); ?>
2014-11-21 08:26:20 +00:00
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->