示例#1
0
 /**
  * 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;
 }
示例#2
0
文件: Auth.php 项目: skank/skankydev
 public function setBackLink()
 {
     if (!Session::get('skankydev.backlink')) {
         Session::set('skankydev.backlink', $this->historique->comeFrom());
     }
 }
示例#3
0
 public function set($message, $attr = [])
 {
     $this->messages[] = ['messages' => $message, 'attr' => $attr];
     Session::set('FlashMessage', $this->messages);
 }
示例#4
0
 /**
  * set the last
  * @return [type] [description]
  */
 function notDirect()
 {
     $this->history[0]['direct'] = false;
     Session::set('skankydev.historique.0.direct', false);
 }