Hi Everyone!
I'm having an issue: I created a snippet with a link to refresh the page:
<?php
$output = "<a href=\"".$_SERVER['PHP_SELF']."?a=test\">Refresh</a>";
return $output;
When I do that, $output return "index.php"
So, after doing some research, I found this solution:
<?php
$url = $modx->makeUrl($modx->resource->get('id'),'',array('a' => 'test'));
$output = <a href=\"".$url."\">Refresh</a>
return $output;
However, it doesn't completely work like a PHP_SELF, because it loads the page at the top of the page. If I'm in the middle of a page and I reload it, I don't want to have to scroll back down to where I was at.
I also found the following function:
$modx->sendRedirect($url)
but I can't put that in an <a> tag.
Is there any other way to achieve a reload of the same page at the same location?
Thank you.