mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
Use MultiFormStep::Link to generate href
This commit is contained in:
parent
adda533de7
commit
68d374208b
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<% if $LinkingMode = current %>
|
||||
<% else %>
|
||||
<% if $ID %>
|
||||
<a href="{$Top.URLSegment}/?{$Top.GetVar}={$Session.Hash}&StepID={$ID}">
|
||||
<a href="$Link">
|
||||
<% end_if %>
|
||||
<% end_if %>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user