/** * Initializes the confirm element * @return boolean Returns true if redirect happens */ protected function Init() { $this->confirm = ContentRegisterConfirm::Schema()->ByContent($this->Content()); $this->confirmer = new Confirmer(); $this->isValid = $this->confirmer->Check(Request::GetArray()); if ($this->isValid) { $this->OnSuccess(); } else { if ($this->confirm->GetErrorUrl()) { Response::Redirect(FrontendRouter::Url($this->confirm->GetErrorUrl())); return true; } } return parent::Init(); }
/** * Gets the confirm database schema * @return ContentRegisterConfirmSchema */ protected function ElementSchema() { return ContentRegisterConfirm::Schema(); }