Esempio n. 1
0
 public function create()
 {
     Assert::isTrue(IntelliForm::submitted(true), 'The form was not submitted.');
     Assert::isTrue($this->checkFormValues() && $this->processForm(), 'The form data has not been processed correctly.');
     // Back to homepage...
     $this->getRouter()->forward(DEFAULT_CONTROLLER, DEFAULT_ACTION);
 }
Esempio n. 2
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));
 }