コード例 #1
0
ファイル: Former.php プロジェクト: jarnstedt/former
 /**
  * Class constructor
  *
  * @param \Illuminate\Html\HtmlBuilder      $html
  * @param \Illuminate\Routing\UrlGenerator  $url
  * @param \Illuminate\Session\Store         $session
  * @param \Illuminate\Config\Repository     $config
  */
 public function __construct(HtmlBuilder $html, UrlGenerator $url, Session $session, Config $config)
 {
     $this->url = $url;
     $this->html = $html;
     $this->csrfToken = $session->getToken();
     $this->config = $config;
     $this->loadConfig();
     $this->session = $session;
     $this->errors = $session->get('errors');
 }
コード例 #2
0
 /**
  * The constructor
  *
  * @param HtmlBuilder  $html
  * @param UrlGenerator $url
  * @param Session      $session
  */
 public function __construct(HtmlBuilder $html, UrlGenerator $url, Session $session)
 {
     parent::__construct($html, $url, $session->getToken());
     $this->session = $session;
     $this->requiredFields = [];
     $this->errorFields = [];
     if ($this->session->has('formhelper-required-fields')) {
         $this->requiredFields = $this->session->get('formhelper-required-fields');
         $this->session->forget('formhelper-required-fields');
     }
     if ($this->session->has('formhelper-error-fields')) {
         $this->errorFields = $this->session->get('formhelper-error-fields');
         $this->session->forget('formhelper-error-fields');
     }
 }
コード例 #3
0
ファイル: _ide_helper.php プロジェクト: satriashp/tour
 /**
  * Get the CSRF token value.
  *
  * @return string 
  * @static 
  */
 public static function getToken()
 {
     return \Illuminate\Session\Store::getToken();
 }
コード例 #4
0
 /**
  * Generate a hidden field with the current CSRF token.
  *
  * @return string
  */
 public function token()
 {
     $token = !empty($this->csrfToken) ? $this->csrfToken : $this->session->getToken();
     return $this->hidden('_token', $token);
 }