Form->create('DistanceCalculator') ?>
Form->control('from._ids', [ 'type' => 'select', 'options' => $locationsFrom, 'value' => $fromId, ]); if ($fromAddress !== null) { echo $this->Form->control('from-address', [ 'type' => 'textarea', 'rows' => 1, 'default' => $fromAddress, 'disabled' => 'disabled' ]); } echo $this->Form->control('to._ids', [ 'type' => 'select', 'options' => $locationsTo, 'value' => $toId, ]); if ($toAddress !== null) { echo $this->Form->control('to-address', [ 'type' => 'textarea', 'rows' => 1, 'default' => $toAddress, 'disabled' => 'disabled' ]); } echo $this->Form->control('distance', [ 'type' => 'textarea', 'rows' => 1, 'default' => $distanceCalculated, 'disabled' => 'disabled' ]); ?>
Form->button(__('Calculate')) ?> Form->end() ?>