/** * create the form balise * @param string $action the url for valide form * @param array $attr the attribute * @param string $method the method of form (default POST) * @param string $csrf active CSRF protection * @return string the balise form */ public function start($action, $attr = [], $method = 'POST', $csrf = true) { $retour = '<form action="' . $action . '" '; $attr = array_merge($this->formAttr, $attr); $retour .= $this->createAttr($attr); $retour .= 'method="' . $method . '">'; if ($csrf) { $token = new Token(); Session::set('skankydev.form.csrf', $token); $retour .= $this->input('_token', ['type' => 'hidden', 'value' => $token->value]); } return $retour; }
public function setBackLink() { if (!Session::get('skankydev.backlink')) { Session::set('skankydev.backlink', $this->historique->comeFrom()); } }
public function set($message, $attr = []) { $this->messages[] = ['messages' => $message, 'attr' => $attr]; Session::set('FlashMessage', $this->messages); }
/** * set the last * @return [type] [description] */ function notDirect() { $this->history[0]['direct'] = false; Session::set('skankydev.historique.0.direct', false); }