コード例 #1
0
ファイル: view.php プロジェクト: nshontz/laravel-blog
 /**
  * Create a new view instance.
  *
  * @param  string  $view
  * @param  array   $data
  * @return void
  */
 public function __construct($view, $data = array())
 {
     $this->view = $view;
     $this->data = $data;
     $this->path = $this->path($view);
     // If a session driver has been specified, we will bind an instance of
     // the validation error message container to every view. If an errors
     // instance exists in the session, we will use that instance.
     //
     // This makes the implementation of the Post/Redirect/Get pattern very
     // convenient since each view can assume it has a message container.
     if (Config::$items['session']['driver'] !== '' and IoC::core('session')->started()) {
         $this->data['errors'] = IoC::core('session')->get('errors', function () {
             return new Messages();
         });
     }
 }
コード例 #2
0
ファイル: request.php プロジェクト: jknox12/mirror
 /**
  * Determine if the request has been forged.
  *
  * The session CSRF token will be compared to the CSRF token in the request input.
  *
  * @return bool
  */
 public static function forged()
 {
     return static::csrf_token() !== IoC::core('session')->token();
 }
コード例 #3
0
ファイル: form.php プロジェクト: nshontz/laravel-blog
 /**
  * Generate a hidden field containing the current CSRF token.
  *
  * @return string
  */
 public static function token()
 {
     return static::input('hidden', Session::csrf_token, IoC::core('session')->token());
 }
コード例 #4
0
ファイル: request.php プロジェクト: nshontz/laravel-blog
 /**
  * Determine if the request has been forged.
  *
  * The session CSRF token will be compared to the CSRF token in the request input.
  *
  * @return bool
  */
 public static function forged()
 {
     return Input::get(Session::csrf_token) !== IoC::core('session')->token();
 }