e107help.org Q&A
0 like 0 dislike

In previous plugins, I could easily program to return to the previous page with this kind of coding:

    $text = "<br /><center><input class='btn btn-success' type=button value='Back' onClick='history.go(-1)'></center>";
    $ns -> tablerender("Error page", $text);
    require_once(e_ADMIN.'footer.php');

In e107 v2 this still works, but when coming from a form page with values, instead of retrieving the old values, I get a new refresh page with nothing filled in. I would use this technique to display a page with warnings and/or errors and then let the user return to the previous page with all the filled in values, so they only need to correct maybe one or two fields instead of filling everything from scratch. What is the best v2 way of doing this. Any coding examples present that display this kind of behavior?

e107 version 2.2.1
closed with the note: answered, otherwise question for core developers on github
in Plugins by (22 points) 1 1 4
closed by
Ask on GitHub, template question. You will not get an answer to this type of question here.

1 Answer

0 like 0 dislike

You can look for

e107::getRedirect()->setPreviousUrl();

e107::getRedirect()->getPreviousUrl();

But with the new version, it is a maybe better idea to use getMessage() and display it above form with errors. 

New Admin UI is managing this (saving post values) itself. 

 

by (1.9k points) 15 46 57
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
931 questions
1,332 answers
2,332 comments
2,302 users