Use MultiFormStep::Link to generate href

This commit is contained in:
Will Rossiter 2017-09-12 10:09:24 +12:00
parent adda533de7
commit 68d374208b
2 changed files with 6 additions and 6 deletions

View File

@ -145,19 +145,19 @@ class MultiFormStep extends DataObject
}
/**
* Gets a direct link to this step (only works
* if you're allowed to skip steps, or this step
* has already been saved to the database
* for the current {@link MultiFormSession}).
* Gets a direct link to this step (only works if you're allowed to skip
* steps, or this step has already been saved to the database for the
* current {@link MultiFormSession}).
*
* @return string Relative URL to this step
*/
public function Link()
{
$form = $this->form;
return Controller::join_links(
$form->getDisplayLink(),
"?{$form->getGetVar()}={$this->getSession()->Hash}"
sprintf("?%s=%s&StepID=%s", $form->getGetVar(), $this->getSession()->Hash, $this->ID)
);
}

View File

@ -4,7 +4,7 @@
<% if $LinkingMode = current %>
<% else %>
<% if $ID %>
<a href="{$Top.URLSegment}/?{$Top.GetVar}={$Session.Hash}&amp;StepID={$ID}">
<a href="$Link">
<% end_if %>
<% end_if %>