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


PHP SessionManager::get方法代码示例

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


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

示例1:

 /**
  * @param Organization   $organization
  * @param User           $user
  * @param SessionManager $sessionManager
  */
 function __construct(Organization $organization, User $user, SessionManager $sessionManager)
 {
     $this->organization = $organization;
     $this->user = $user;
     $this->sessionManager = $sessionManager;
     $this->orgId = $this->sessionManager->get('org_id');
 }
开发者ID:younginnovations,项目名称:aidstream,代码行数:12,代码来源:UserController.php

示例2: render

 /**
  * Render the notifications' script tag
  *
  * @return string
  * @internal param bool $flashed Whether to get the
  *
  */
 public function render()
 {
     $notifications = $this->session->get('toastr::notifications');
     if (!$notifications) {
         $notifications = [];
     }
     $output = '<script type="text/javascript">';
     $lastConfig = [];
     foreach ($notifications as $notification) {
         $config = $this->config->get('toastr.options');
         if (count($notification['options']) > 0) {
             // Merge user supplied options with default options
             $config = array_merge($config, $notification['options']);
         }
         // Config persists between toasts
         if ($config != $lastConfig) {
             $output .= 'toastr.options = ' . json_encode($config) . ';';
             $lastConfig = $config;
         }
         // Toastr output
         $output .= 'toastr.' . $notification['type'] . "('" . str_replace("'", "\\'", str_replace(['&lt;', '&gt;'], ['<', '>'], e($notification['message']))) . "'" . (isset($notification['title']) ? ", '" . str_replace("'", "\\'", htmlentities($notification['title'])) . "'" : null) . ');';
     }
     $output .= '</script>';
     return $output;
 }
开发者ID:petrovitch,项目名称:smoothing,代码行数:32,代码来源:Toastr.php

示例3: 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

示例4: __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

示例5: retrieveAccessToken

 /**
  * {@inheritDoc}
  */
 public function retrieveAccessToken($service)
 {
     $name = $this->storageName($service);
     if ($token = $this->session->get($name)) {
         return unserialize($token);
     }
     throw new TokenNotFoundException('Token not found in session, are you sure you stored it?');
 }
开发者ID:develme,项目名称:oauth-4-laravel,代码行数:11,代码来源:TokenStorage.php

示例6: getValueForSection

 public function getValueForSection($section, $key = null, $default = null)
 {
     $values = $this->sessionManager->get($section);
     if (!$key) {
         return $values;
     }
     return isset($values[$key]) ? $values[$key] : $default;
 }
开发者ID:mesour,项目名称:laravel-bridges,代码行数:8,代码来源:Session.php

示例7: check

 /**
  * Check if string matches captcha
  * @param $string
  * @param $formId
  * @return bool
  */
 public function check($string, $formId = null)
 {
     if (empty($formId)) {
         //$formId = $this->fromCurrentUrl();
         $formId = $this->fromAppKey();
     }
     $hash = $this->session->get("{$this->storeKey}.{$formId}");
     return $this->hash($this->config->get('captcha.case_sensitive') ? $string : strtolower($string)) == $hash;
 }
开发者ID:thytanium,项目名称:captcha,代码行数:15,代码来源:Captcha.php

示例8: getRecentAuthData

 /**
  * Allows you retrieve the most recent social provider
  * authorized with.
  *
  * @return mixed
  */
 public function getRecentAuthData()
 {
     $providers = $this->session->get('__sp_auth.p');
     if (!$providers) {
         return null;
     }
     return array_first($providers, function ($provider) {
         return $provider === $this->session->get('__sp_auth.r');
     });
 }
开发者ID:morrelinko,项目名称:laravel5-socialplus,代码行数:16,代码来源:SocialPlus.php

示例9: session

 /**
  * Get session.
  *
  * @param string|null $key
  * @param mixed       $default
  *
  * @return \Illuminate\Session\SessionManager|mixed
  */
 public function session($key = null, $default = null)
 {
     if (!isset($this->session)) {
         $this->session = app('session');
     }
     if (is_null($key)) {
         return $this->session;
     }
     return $this->session->get($key, $default);
 }
开发者ID:Hiroto-K,项目名称:HkApps,代码行数:18,代码来源:RequestTrait.php

示例10:

 /**
  * @param Activity              $activity
  * @param IatiIdentifierManager $iatiIdentifierManager
  * @param Identifier            $identifier
  * @param OrganizationManager   $organizationManager
  * @param SessionManager        $sessionManager
  * @param ActivityManager       $activityManager
  */
 function __construct(Activity $activity, IatiIdentifierManager $iatiIdentifierManager, Identifier $identifier, OrganizationManager $organizationManager, SessionManager $sessionManager, ActivityManager $activityManager)
 {
     $this->middleware('auth');
     $this->activity = $activity;
     $this->iatiIdentifierManager = $iatiIdentifierManager;
     $this->identifier = $identifier;
     $this->organizationManager = $organizationManager;
     $this->sessionManager = $sessionManager;
     $this->organization_id = $this->sessionManager->get('org_id');
     $this->activityManager = $activityManager;
 }
开发者ID:younginnovations,项目名称:aidstream,代码行数:19,代码来源:IatiIdentifierController.php

示例11:

 /**
  * @param OrganizationManager   $organizationManager
  * @param SessionManager        $sessionManager
  * @param ActivityManager       $activityManager
  * @param UploadActivityManager $uploadActivityManager
  * @param UploadActivity        $uploadActivity
  * @param SettingsManager       $settingsManager
  */
 function __construct(OrganizationManager $organizationManager, SessionManager $sessionManager, ActivityManager $activityManager, UploadActivityManager $uploadActivityManager, UploadActivity $uploadActivity, SettingsManager $settingsManager)
 {
     $this->middleware('auth');
     $this->activityManager = $activityManager;
     $this->uploadActivity = $uploadActivity;
     $this->uploadActivityManager = $uploadActivityManager;
     $this->sessionManager = $sessionManager;
     $this->organizationId = $this->sessionManager->get('org_id');
     $this->organizationManager = $organizationManager;
     $this->settingsManager = $settingsManager;
 }
开发者ID:younginnovations,项目名称:aidstream,代码行数:19,代码来源:ActivityUploadController.php

示例12: 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

示例13: getuserfolder

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

示例14: __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

示例15: getPersistentData

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


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