PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- /* @var $this TeacherController */
- /* @var $model Teacher */
- /* @var $form CActiveForm */
- Yii::import('ext.imperavi-redactor-widget.ImperaviRedactorWidget');
- ?>
- <div class="form">
- 'id'=>'teacher-form',
- // Please note: When you enable ajax validation, make sure the corresponding
- // controller action is handling ajax validation correctly.
- // There is a call to performAjaxValidation() commented in generated controller code.
- // See class documentation of CActiveForm for details on this.
- 'enableAjaxValidation'=>false,
- )); ?>
- <p class="note">Поля отмеченые <span class="required">*</span> обязательны.</p>
- <?PHP echo $form->errorSummary($model); ?>
- <div class="row">
- <h2><?PHP echo $form->labelEx($model,'login'); ?></h2>
- <?PHP echo $form->error($model,'login'); ?>
- </div>
- <div class="row">
- <h2><?PHP echo $form->labelEx($model,'password'); ?></h2>
- <?PHP echo $form->error($model,'password'); ?>
- </div>
- <div class="row">
- <h2><?PHP echo $form->labelEx($model,'name'); ?></h2>
- <?PHP echo $form->error($model,'name'); ?>
- </div>
- <div class="row">
- <h2><?PHP echo $form->labelEx($model,'info'); ?></h2>
- <?PHP
- // You can either use it for model attribute
- 'model' => $model,
- 'attribute' => 'info',
- 'lang' => 'ru',
- 'toolbar' => true,
- 'iframe' => true,
- 'buttons' => ['html', 'formatting', 'bold', 'italic', 'deleted',
- 'unorderedlist', 'orderedlist', 'outdent', 'indent',
- 'table', 'link', 'alignment', 'horizontalrule',
- 'underline', 'alignleft', 'aligncenter', 'alignright', 'justify'],
- 'minHeight' => 150
- ),
- ));
- ?>
- <?PHP echo $form->error($model,'info'); ?>
- </div>
- <div class="row">
- <h2><?PHP echo $form->labelEx($model,'lesson'); ?></h2>
- <?PHP
- // You can either use it for model attribute
- 'model' => $model,
- 'attribute' => 'lesson',
- 'lang' => 'ru',
- 'toolbar' => true,
- 'iframe' => true,
- 'buttons' => ['html', 'formatting', 'bold', 'italic', 'deleted',
- 'unorderedlist', 'orderedlist', 'outdent', 'indent',
- 'table', 'link', 'alignment', 'horizontalrule',
- 'underline', 'alignleft', 'aligncenter', 'alignright', 'justify'],
- 'minHeight' => 150
- ),
- ));
- ?>
- <?PHP echo $form->error($model,'lesson'); ?>
- </div>
- <div class="row">
- <h2><?PHP echo $form->labelEx($model,'work'); ?></h2>
- <?PHP
- // You can either use it for model attribute
- 'model' => $model,
- 'attribute' => 'work',
- 'lang' => 'ru',
- 'toolbar' => true,
- 'iframe' => true,
- 'buttons' => ['html', 'formatting', 'bold', 'italic', 'deleted',
- 'unorderedlist', 'orderedlist', 'outdent', 'indent',
- 'table', 'link', 'alignment', 'horizontalrule',
- 'underline', 'alignleft', 'aligncenter', 'alignright', 'justify'],
- 'minHeight' => 150
- ),
- ));
- ?>
- <?PHP echo $form->error($model,'work'); ?>
- </div>
- <div class="row">
- <h2>Дипломы и сертификаты</h2>
- <p>Добавление</p>
- <?PHP
- 'name' => 'diplomsAdd',
- 'accept' => 'jpeg|jpg|gif|png', // useful for verifying files
- 'duplicate' => 'Duplicate file!', // useful, i think
- 'denied' => 'Invalid file type', // useful, i think
- ));
- ?>
- <?PHP
- {
- echo '<br /><p>Удаление</p>';
- $index = 1;
- foreach($model->diplomImages as $image)
- {
- echo '<input value="'.$image->id.'" id="diplomsRem_'.$index.'" type="checkbox" name="diplomsRem[]">';
- echo '<label for="diplomsRem_'.$index.'">'.CHtml::image($image->path,'',array('width'=>100,'height'=>100)).'</label>';
- $index++;
- }
- }
- ?>
- </div>
- <div class="row">
- <h2>Фото</h2>
- <p>Добавление</p>
- <?PHP
- 'name' => 'fotoAdd',
- 'accept' => 'jpeg|jpg|gif|png', // useful for verifying files
- 'duplicate' => 'Duplicate file!', // useful, i think
- 'denied' => 'Invalid file type', // useful, i think
- ));
- ?>
- <?PHP
- {
- echo '<br /><p>Удаление</p>';
- $index = 1;
- foreach($model->fotoImages as $image)
- {
- echo '<input value="'.$image->id.'" id="fotoRem_'.$index.'" type="checkbox" name="fotoRem[]">';
- echo '<label for="fotoRem_'.$index.'">'.CHtml::image($image->path,'',array('width'=>100,'height'=>100)).'</label>';
- $index++;
- }
- }
- ?>
- </div>
- <div class="row">
- <h2><?PHP echo $form->labelEx($model,'award'); ?></h2>
- <?PHP
- // You can either use it for model attribute
- 'model' => $model,
- 'attribute' => 'award',
- 'lang' => 'ru',
- 'toolbar' => true,
- 'iframe' => true,
- 'buttons' => ['html', 'formatting', 'bold', 'italic', 'deleted',
- 'unorderedlist', 'orderedlist', 'outdent', 'indent',
- 'table', 'link', 'alignment', 'horizontalrule',
- 'underline', 'alignleft', 'aligncenter', 'alignright', 'justify'],
- 'minHeight' => 150
- ),
- ));
- ?>
- <?PHP echo $form->error($model,'award'); ?>
- </div>
- <div class="row">
- <h2><?PHP echo $form->labelEx($model,'avatar'); ?></h2>
- <?PHP echo CHtml::activeFileField($model, 'avatar'); ?>
- <?PHP echo $form->error($model,'avatar'); ?>
- </div>
- <div class="row buttons">
- <?PHP echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
- </div>
- <?PHP $this->endWidget(); ?>
- </div><!-- form -->