Beispiel #1
0
 public function renderForm()
 {
     if (isset($this->form) && $this->form->active) {
         $model = $this->model;
         $activeForm = $this->activeForm;
         $fieldsHtml = FormUtil::getFieldsHtml($activeForm, $this->model, ['label' => $this->showLabel]);
         echo $fieldsHtml;
         if ($this->form->captcha) {
             if ($this->showLabel) {
                 $captchaHtml = $activeForm->field($model, 'captcha')->widget(Captcha::classname(), ['options' => ['placeholder' => 'Captcha*']]);
             } else {
                 $captchaHtml = $activeForm->field($model, 'captcha')->label(false)->widget(Captcha::classname(), ['options' => ['placeholder' => 'Captcha*']]);
             }
             echo $captchaHtml;
         }
         if (!isset($this->formActions)) {
             echo "<div class='frm-actions'><input type='submit' value='Submit' /></div>";
         } else {
             echo $this->formActions;
         }
     } else {
         echo "<div class='warning'>Form submission is disabled by site admin.</div>";
     }
 }
Beispiel #2
0
use yii\helpers\Url;
use yii\widgets\ActiveForm;
// CMG Imports
use cmsgears\core\common\utilities\FormUtil;
include 'header.php';
?>
<section class="wrap-content container clearfix">
	<div class="cud-box">
		<h2>Update <?php 
echo ucfirst($type);
?>
 Settings</h2>
		<?php 
$form = ActiveForm::begin(['id' => 'frm-update-settings', 'options' => ['class' => 'frm-split']]);
?>

		<?php 
echo FormUtil::getFieldsHtml($form, $model);
?>

		<div class="box-filler"></div>
		<?php 
echo Html::a("Back", ["index?type={$type}"], ['class' => 'btn']);
?>
		<input type="submit" value="Update" />

		<?php 
ActiveForm::end();
?>
	</div>
</section>