public function actionFields($id) { $model = $this->loadModel($id); //echo CJSON::encode("echo ".$model->value); $form = $model->loadPayment(); //$form = new $model->value; $form->type = $id; $form->sum = $_POST['bill']['sum']; $form->line = (int) $_POST['bill']['line']; $text = ''; foreach ($form->field() as $field => $type) { $text .= EAVHelper::addRow($field, '', $type, 'Doccheques[' . $form->line . ']'); } echo CJSON::encode(array("line" => $form->line, "form" => $text, "bill" => $form->stoppage())); }
public function run() { $this->beginWidget('TbPanel', array('header' => $this->header)); $col1 = $col = ''; $print = true; foreach ($this->models as $sModel) { if ($sModel->priority >= $this->from && $sModel->priority <= $this->to) { $tmp = EAVHelper::addRow($sModel->id, $sModel->value, $sModel); if ($print) { $col .= $tmp; $print = false; } else { $col1 .= $tmp; $print = true; } } } echo "<div class='col-xs-6'>{$col1}</div><div class='col-xs-6'>{$col}</div>"; $this->endWidget(); }
<div class="form"> <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'itemcategory-form', 'enableAjaxValidation' => true)); ?> <?php echo $form->errorSummary($model); ?> <?php foreach ($model->getSettings() as $sModel) { //if ($sModel->hidden == 0) { echo EAVHelper::addRow($sModel->id, $sModel->value, $sModel); //} } ?> <div class="form-actions"> <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? Yii::t('app', "Create") : Yii::t('app', "Save"))); ?> </div> <?php $this->endWidget(); ?>