backlink from one presenter view to an other

Notice: This thread is very old.
pistols
Member | 26
+
0
-

Hi there,

I would like to ask you for your help with an issue I am facing.

I have some components (forms) that can be linked from any presenter in my app. I would like to set “nicely” the ability to redirect back to the page from where i called the form in the first place.

simple example

<?php
class Users {
	public function renderUsersStuff() {
		$this->template->stuff = getHisStuff();
        }
}
?>

template usersStuff.latte

<?php
{foreach stuff as item}
	<div>{$item->name}<a n:href="Stuff:edit $item->id" />edit</a></div>
{/foreach}
?>

Now, if the user clicks on the stuff:edit action, he will be redirected to a different page on a different presenter, with a form in it. After submitting, I need to get him back from where he came from. For this example to usersStuff.

I have read this but I guess i am missing something obvious. I don't know how to pass the storedRequest to the presenter which creates the component.

I hope you understand my question :)

Greets

pistols
Member | 26
+
0
-

This looks that is working, but is it the best way how to do it?

<?php
{foreach stuff as item}
    <div>{$item->name}<a n:href="Stuff:edit $item->id bl => $backlink" />edit</a></div>
{/foreach}
?>
Oli
Member | 1215
+
0
-

I belive it is best practice if you want have parameter in URL. If you don't want this parameter in URL you can use $httpRequest->getReferer()->host and make something around it. For example if it is from your website.