当前位置: 首页>>代码示例>>PHP>>正文


PHP SessionManager::has方法代码示例

本文整理汇总了PHP中Illuminate\Session\SessionManager::has方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager::has方法的具体用法?PHP SessionManager::has怎么用?PHP SessionManager::has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Session\SessionManager的用法示例。


在下文中一共展示了SessionManager::has方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: preSet

 public function preSet(FormEvent $event)
 {
     $form = $event->getForm();
     $rootName = $form->getRoot()->getName();
     if (!$form->isRoot() && ($parent = $form->getParent())) {
         $name = $this->getDottedName($form);
         $fullName = $this->getFullName($rootName, $name);
         // Add input from the previous submit
         if ($form->getName() !== '_token' && $this->session->hasOldInput($fullName)) {
             // Get old value
             $value = $this->session->getOldInput($fullName);
             // Transform back to good data
             $value = $this->transformValue($event, $value);
             // Store on the form
             $event->setData($value);
         }
         if ($this->session->has('errors')) {
             /** @var \Illuminate\Support\ViewErrorBag $errors */
             $errors = $this->session->get('errors');
             if ($errors->has($name)) {
                 $form->addError(new FormError(implode(' ', $errors->get($name))));
             }
         }
     }
 }
开发者ID:barryvdh,项目名称:laravel-form-bridge,代码行数:25,代码来源:SessionListener.php

示例2: __construct

 public function __construct()
 {
     $this->sessionManager = app(SessionManager::class);
     if ($this->sessionManager->has('flash_messages')) {
         $this->messages = $this->sessionManager->get('flash_messages');
     }
 }
开发者ID:marius321967,项目名称:laravel-messages,代码行数:7,代码来源:MessageHandler.php

示例3: setLocation

 /**
  * Sets the location property to the drivers returned location object.
  *
  * @param string $ip
  */
 private function setLocation($ip = '')
 {
     // The location session key.
     $key = 'location';
     // Removes location from the session if config option is set
     if ($this->localHostForgetLocation()) {
         $this->session->forget($key);
     }
     // Check if the location has already been set in the current session
     if ($this->session->has($key)) {
         // Set the current driver to the current session location
         $this->location = $this->session->get($key);
     } else {
         $this->setIp($ip);
         $this->location = $this->driver->get($this->ip);
         // The locations object property 'error' will be true if an
         // exception has occurred trying to grab the location
         // from the driver. Let's try retrieving the
         // location from one of our fall-backs
         if ($this->location->error) {
             $this->location = $this->getLocationFromFallback();
         }
         $this->session->set($key, $this->location);
     }
 }
开发者ID:muhamadsyahril,项目名称:location,代码行数:30,代码来源:Location.php

示例4: hasMessage

 public function hasMessage()
 {
     if (!$this->session->has('message')) {
         return false;
     }
     return true;
 }
开发者ID:yewei-cao,项目名称:noodle,代码行数:7,代码来源:Cart.php

示例5: getuserfolder

 function getuserfolder()
 {
     $session = new Session('demo');
     if ($session->has('userfolder')) {
         $value = $session->get('userfolder');
     }
     return $value;
 }
开发者ID:thaigialai1987,项目名称:qlcv,代码行数:8,代码来源:myhelpers.php

示例6: __construct

 public function __construct(SessionManager $session, $messages = array())
 {
     $this->session = $session;
     if ($session->has($this->session_key)) {
         $messages = array_merge_recursive($session->get($this->session_key), $messages);
     }
     parent::__construct($messages);
 }
开发者ID:NewwayLibs,项目名称:nw-core,代码行数:8,代码来源:FlashMessageBag.php

示例7: clearPersistentData

 /**
  * {@inheritdoc}
  *
  * @see BaseFacebook::clearPersistentData()
  */
 protected function clearPersistentData($key)
 {
     if (!in_array($key, self::$kSupportedKeys)) {
         self::errorLog('Unsupported key passed to clearPersistentData.');
         return;
     }
     $session_var_name = $this->constructSessionVariableName($key);
     if ($this->laravelSession->has($session_var_name)) {
         $this->laravelSession->forget($session_var_name);
     }
 }
开发者ID:pageboost,项目名称:facebook-laravel,代码行数:16,代码来源:LaravelFacebook.php

示例8: identified

 /**
  * 문서에 대해서 인증한 세션이 있는지 체크
  *
  * @param ItemEntity $item board item entity
  * @return bool
  */
 public function identified(ItemEntity $item)
 {
     $sessionName = $this->getKey($item->id);
     if ($this->session->has($sessionName) === false) {
         return false;
     }
     if ($this->validate($item) === false) {
         return false;
     }
     // 세션 갱신
     $this->destroy($item);
     $this->create($item);
     return true;
 }
开发者ID:khongchi,项目名称:plugin-board,代码行数:20,代码来源:IdentifyManager.php

示例9: identified

 /**
  * 문서에 대해서 인증한 세션이 있는지 체크
  *
  * @param Board $board board model
  * @return bool
  */
 public function identified(Board $board)
 {
     $sessionName = $this->getKey($board->id);
     if ($this->session->has($sessionName) === false) {
         return false;
     }
     if ($this->validate($board) === false) {
         return false;
     }
     // 세션 갱신
     $this->destroy($board);
     $this->create($board);
     return true;
 }
开发者ID:xpressengine,项目名称:plugin-board,代码行数:20,代码来源:IdentifyManager.php

示例10: edit

 /**
  * Shows the form for item editing.
  *
  * @param string $model Model to use.
  * @param int $id Item ID.
  * @return \Illuminate\Http\Response
  */
 public function edit($model, $id)
 {
     $this->setModel($model);
     $this->checkAction('edit');
     $item = $this->staticModelgetFormItem($id);
     if (!$item) {
         abort(404);
     }
     $title = trans('lavanda::common.edit_title', ['entity' => mb_strtolower($this->staticModelGetName()), 'id' => $id]);
     $form = $this->staticModelGetForm('put', $this->getRoute('update', ['id' => $id]), $this->session->hasOldInput() ? null : $item);
     if (!$this->session->has('back_url')) {
         $this->session->flash('back_url', $this->request->server('HTTP_REFERER'));
     } else {
         $this->session->reflash();
     }
     return view('lavanda::entity.edit', ['title' => $title, 'form' => $form]);
 }
开发者ID:idealogica,项目名称:lavanda,代码行数:24,代码来源:EntityController.php

示例11: setLocation

 /**
  * Sets the location property to the drivers returned location object.
  *
  * @param string $ip
  */
 private function setLocation($ip = '')
 {
     /*
      * Removes location from the session if config option is set
      */
     if ($this->localHostForgetLocation()) {
         $this->session->forget('location');
     }
     /*
      * Check if the location has already been set in the current session
      */
     if ($this->session->has('location')) {
         /*
          * Set the current driver to the current session location
          */
         $this->location = $this->session->get('location');
     } else {
         /*
          * Set the IP
          */
         $this->setIp($ip);
         /*
          * Set the location
          */
         $this->location = $this->driver->get($this->ip);
         /*
          * The locations object property 'error' will be true if an exception has
          * occurred trying to grab the location from the driver. Let's
          * try retrieving the location from one of our fall-backs
          */
         if ($this->location->error) {
             $this->location = $this->getLocationFromFallback();
         }
         $this->session->set('location', $this->location);
     }
 }
开发者ID:ktardthong,项目名称:beerhit,代码行数:41,代码来源:Location.php

示例12: getContent

 /**
  * Get the carts content, if there is no cart content set yet, return a new empty Collection
  *
  * @return CartCollection
  */
 protected function getContent()
 {
     $content = $this->session->has($this->getInstance()) ? $this->session->get($this->getInstance()) : new CartCollection();
     return $content;
 }
开发者ID:stevethomas,项目名称:LaravelShoppingcart,代码行数:10,代码来源:Cart.php

示例13: hasAccessToken

 /**
  * {@inheritDoc}
  */
 public function hasAccessToken($service)
 {
     $name = $this->storageName($service);
     return $this->session->has($name);
 }
开发者ID:develme,项目名称:oauth-4-laravel,代码行数:8,代码来源:TokenStorage.php


注:本文中的Illuminate\Session\SessionManager::has方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。