/** * MODULE : Formulaire de contact */ public function index() { // Envoi du mail if ($this->getPost('submit')) { $mail = helpers::mail($this->getPost('subject', helpers::STRING), $this->getData($this->getUrl(0), 'mail'), $this->getPost('subject', helpers::STRING), $this->getPost('message', helpers::STRING)); if ($mail) { $this->setNotification('Mail envoyé avec succès !'); } else { $this->setNotification('Impossible d\'envoyer le mail !'); } helpers::redirect($this->getUrl()); } // Interface d'écriture de mail self::$content = template::openForm() . template::openRow() . template::text('mail', ['label' => 'Adresse mail', 'required' => true, 'col' => 6]) . template::newRow() . template::text('subject', ['label' => 'Sujet', 'required' => true, 'col' => 6]) . template::newRow() . template::textarea('message', ['label' => 'Sujet', 'required' => true, 'col' => 7]) . template::newRow() . template::submit('submit', ['col' => 2]) . template::closeRow() . template::closeForm(); }