Ejemplo n.º 1
0
 /**
  * (non-PHPdoc)
  *
  * @see \PHPYAM\core\interfaces\IRouter::forward()
  */
 public final function forward($urlController, $urlAction, array $urlParameters = array(), $clearOutputBuffersBeforeRedirect = true)
 {
     if ($clearOutputBuffersBeforeRedirect) {
         // We empty all buffers.
         while (ob_get_level() > 0) {
             ob_end_clean();
         }
     }
     // We check that the header() statements have been taken into account,
     // which is only possible if the HTTP headers have not been sent yet.
     Assert::isFalse(headers_sent(), StringUtils::gettext('HTTP headers have already been sent.'));
     header('location:' . Core::url($urlController, $urlAction, $urlParameters));
 }