-3

Parse error: syntax error, unexpected T_IF in update.php on line 90

I really dont see any problem in my code, why this is happening, please help.

<?= Html::activeHiddenInput($model, 'organization_title') ?>


    <?= $form->field($model, 'reason') ?>

90 line!    <?= if ($model->move_type === 1) { ?>
        <div id="partial-cost">
        <?=  $this->render('_cost-fields', [
            'model' => $model,
            'sourceType' => $sourceType,
            'typeDropdown' => $typeDropdown,
            'targetDropdown' => $targetDropdown,
            'form' => $form
            ]) ?>
        </div>
    <?= } ?>

    <?= if ($model->move_type === 0) { ?>
        <div id="partial-income" >
        <?= $this->render('_income-fields', [
            'model' => $model,
            'sourceType' => $sourceType,
            'typeDropdown' => $typeDropdown,
            'targetDropdown' => $targetDropdown,
            'form' => $form
            ]) ?>
        </div>  
    <?= } ?>



    <div class="form-group">
        <button type="submit" class="btn btn-default">Save</button>
    </div>
Stefan Hansch
  • 1,550
  • 4
  • 22
  • 55

1 Answers1

6

<?= is a shorthand for <?php echo - you can't echo an if-statement.

This also applies to your lines reading <?= } ?>.

Constantin Groß
  • 10,719
  • 4
  • 24
  • 50