FoxSecrets
Active member
I need to display a message after page refresh.
Currently if the message is returned the page is not refreshed, and if refreshed no message is displayed.
Does anyone know how can do both?
PHP
TEMPLATE
Currently if the message is returned the page is not refreshed, and if refreshed no message is displayed.
Does anyone know how can do both?
PHP
Code:
//...
$message = $result['message'];
$this->message(\XF::phrase($message));
$refreshPage = true;
return $this->view('FOX\Products:Product\Index', 'fox_products_index', [
'refreshPage' => $refreshPage
]);
//...
TEMPLATE
Code:
<xf:if is="{{$refreshPage}}">
<script>
window.location.reload();
</script>
</xf:if>
Last edited: