- What goes on in Vegas, stays in Vegas
- What goes on in an iframe, stays in that iframe
I don't think what you want is possible with PHP (and any PHP framework),
Maybe with getting the content of the page that you want to load inside the iframe with:
$http = new Client();
$response = $http->get('http://example.com');
$content = $response->body();
and put the $content in the view in the "top level page / mean not inside iframe" (like they do in financial website), but i'm not sure of the exact way.
the easiest solution is to send in your controller a value ($redirect = true) to the view that will say: "Hey! view, plz open this link to the top level window! / mean outside the iframe".
write something like this in your view (or template):
<!-- ... -->
<?php if($redirect) : ?>
<body onload="javascript:window.top.location.href='<?= $this->Url->build([
"controller" => "Pages",
"action" => "display",
"thank-you"
]) ?>'";>
<?php else: ?>
<body>
<?php endif; ?>
<!-- ... -->
Hope it helps