Question

There's a way to include form inside another form using the same action? I tried with renderPartial but doesn't work. eg:

$this->renderPartial('//utente/_form', array('model'=>new User, 'condition'=>$condition, 'form' => $form, 'rule' => '3'), false, true);

Was it helpful?

Solution

  1. Use renderPartial(with return=true) to render result of first for in temporal variable.
  2. Use the variable in second view.

See CController renderPartial() for details

$form1 = $this->renderPartial('firstView', $data1, true);

$this->renderPartial(
    '//utente/_form',
    array(
        'model'=>new User,
        'condition'=>$condition,
        'form' => $form,
        'rule' => '3',
        'form1' => $form1
    ),
    false,
    true
);

OTHER TIPS

Form inside another form doesn't work in HTML! You can't do this:

<form ...>
      ...
      <form ...>
          ...
      </form>
</form>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top