Example #1
0
 /**
  * Forward the user to a specified url
  *
  * @param string $url The URL to forward to
  * @param integer $code [optional] HTTP status code
  */
 public function forward($url, $code = 200)
 {
     if (Context::getRequest()->isAjaxCall() || Context::getRequest()->getRequestedFormat() == 'json') {
         $this->getResponse()->ajaxResponseText($code, Context::getMessageAndClear('forward'));
     }
     Logging::log("Forwarding to url {$url}");
     Logging::log('Triggering header redirect function');
     $this->getResponse()->headerRedirect($url, $code);
 }