S
S
SoGood962019-03-26 12:20:59
Yii
SoGood96, 2019-03-26 12:20:59

How to save data from edit/create form if it uses foreach?

How can you display this kind of data?

$form = $this->beginWidget('booster.widgets.TbActiveForm',[
    'id' => 'horizontalForm',
    'htmlOptions' => array('class' => 'well'),
    'method' => 'post'
]);

foreach ($doors as $door) {
        echo $form->textFieldGroup($door, 'sum',['label'=>'Стоимость '.$door->s->short_name]);
    }
foreach ($doors_r as $door) {
    echo $form->textFieldGroup($door, 'sum',['label'=>'Возврат '.$door->s->short_name]);
}
$this->widget('booster.widgets.TbButton',[
    'buttonType' => 'submit',
    'label' => 'send'
]);
$this->endWidget();

Has anyone written similar create/edit actions? Not necessarily in Yii, just with a similar use of foreach

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question