Skip to content

Instantly share code, notes, and snippets.

@tylermenezes
Created December 15, 2012 09:43
Show Gist options
  • Select an option

  • Save tylermenezes/4292396 to your computer and use it in GitHub Desktop.

Select an option

Save tylermenezes/4292396 to your computer and use it in GitHub Desktop.
Avoid the requirement that you have a Canvas app to send FB notifications by setting the window top location. Probably against the TOS. Uses CuteControllers, although the concept is easy to copy in any framework.
public function __post_index()
{
$to = $this->request->request('to');
if ($to === NULL) {
$to = '/index.html';
}
$to = \CuteControllers\Router::link($to);
echo '<!DOCTYPE html><head><title>Toasst</title></head><body><h1>Please wait...</h1><script type="text/javascript">top.location.href = "' . $to . '";</script></body></html>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment