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


PHP Store::has方法代码示例

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


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

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->session->has('customer_id')) {
         return redirect()->to('admin');
     }
     return $next($request);
 }
开发者ID:jolupeza,项目名称:wactas,代码行数:15,代码来源:SelectCustomer.php

示例2: getURL

 public function getURL($name)
 {
     if ($this->sessionManager->has($name = $this->getName($name))) {
         return $this->sessionManager->get($name);
     }
     return false;
 }
开发者ID:laravel-commode,项目名称:navigation-bag,代码行数:7,代码来源:NavigationBag.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->session->has($this->sessionKey)) {
         $this->googleTagManager->set($this->session->get($this->sessionKey));
     }
     $response = $next($request);
     $this->session->flash($this->sessionKey, $this->googleTagManager->getFlashData());
     return $response;
 }
开发者ID:paul-schulleri,项目名称:laravel-googletagmanager,代码行数:16,代码来源:GoogleTagManagerMiddleware.php

示例4: __construct

 /**
  * Create a new flash notifier instance.
  *
  * @param Store $session
  */
 public function __construct(Store $session)
 {
     if ($session->has('flash_notification.messages')) {
         $session->forget('flash_notification.messages');
     }
     if ($session->has('flash_notification.important')) {
         $session->forget('flash_notification.important');
     }
     $this->session = $session;
 }
开发者ID:tshafer,项目名称:laravel-flash,代码行数:15,代码来源:FlashNotifier.php

示例5: agegate

 /**
  * Renders the age gate view
  */
 public function agegate()
 {
     $previousTooYoung = $this->session->get('laravel-avp.previous_too_young');
     $view = view(config('agegate.view'))->with(compact('previousTooYoung'));
     if (!$this->session->has('errors') && $previousTooYoung) {
         $messages = $this->lang->get('laravel-avp::validation.custom');
         $errorMsg = $messages['dob.previous'];
         $view->withErrors(['dob' => [$errorMsg]]);
     }
     return $view;
 }
开发者ID:fastwebmedia,项目名称:laravel-avp,代码行数:14,代码来源:AVPController.php

示例6: __construct

 public function __construct(Store $session, Factory $view)
 {
     $this->session = $session;
     $view->share('flash', $this);
     if ($this->session->has($this->namespace)) {
         $flashed = $this->session->get($this->namespace);
         $this->message = $flashed['message'];
         $this->title = $flashed['title'];
         $this->type = $flashed['type'];
         $this->exists = true;
     }
 }
开发者ID:willishq,项目名称:laravel5-flash,代码行数:12,代码来源:Flash.php

示例7: Collection

 /**
  * Create a new flash notifier instance.
  *
  * @param Store       $session
  * @param Application $app
  */
 function __construct(Store $session, Application $app)
 {
     $this->session = $session;
     $this->app = $app;
     $this->messages = $this->session->pull('__messages', new Collection());
     if ($this->session->has('errors')) {
         $errors = $this->session->get('errors')->getBag('default')->getMessages();
         foreach ($errors as $error) {
             $this->add(['message' => current($error), 'type' => 'info', 'class' => 'warning'], false);
         }
     }
 }
开发者ID:portonefive,项目名称:essentials,代码行数:18,代码来源:MessageManager.php

示例8: populate

 /**
  * Populate the fields with entry values.
  *
  * @param FormBuilder $builder
  */
 public function populate(FormBuilder $builder)
 {
     $fields = $builder->getFields();
     $entry = $builder->getFormEntry();
     foreach ($fields as &$field) {
         /*
          * If the field is not already set
          * then get the value off the entry.
          */
         if (!isset($field['value']) && $entry instanceof EloquentModel && $entry->getId()) {
             if ($locale = array_get($field, 'locale')) {
                 $field['value'] = $entry->translateOrDefault($locale)->{$field['field']};
             } else {
                 $field['value'] = $entry->{$field['field']};
             }
         }
         /*
          * If the field has a default value
          * and the entry does not exist yet
          * then use the default value.
          */
         if (isset($field['config']['default_value']) && $entry instanceof EloquentModel && !$entry->getId()) {
             $field['value'] = $field['config']['default_value'];
         }
         /*
          * If the field has a default value
          * and there is no entry then
          * use the default value.
          */
         if (isset($field['config']['default_value']) && !$entry) {
             $field['value'] = $field['config']['default_value'];
         }
         /*
          * If the field is an assignment then
          * use it's config for the default value.
          */
         if (!isset($field['value']) && $entry instanceof EntryInterface && ($type = $entry->getFieldType($field['field']))) {
             $field['value'] = array_get($type->getConfig(), 'default_value');
         }
         /*
          * Lastly if we have flashed data from a front end
          * form handler then use that value for the field.
          */
         if ($this->session->has($field['prefix'] . $field['field'])) {
             $field['value'] = $this->session->pull($field['prefix'] . $field['field']);
         }
     }
     $builder->setFields($fields);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:54,代码来源:FieldPopulator.php

示例9: __construct

 /**
  * 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');
     }
 }
开发者ID:artisaninweb,项目名称:laravel-formvalidation-helper,代码行数:22,代码来源:FormBuilder.php

示例10: retrieve

 /**
  * Retrieve Message instance from Session, the data should be in
  * serialize, so we need to unserialize it first.
  *
  * @return self
  */
 public function retrieve()
 {
     $messages = null;
     if (!isset($this->instance)) {
         $this->instance = new static();
         $this->instance->setSessionStore($this->session);
         if ($this->session->has('message')) {
             $messages = @unserialize($this->session->get('message', ''));
         }
         $this->session->forget('message');
         if (is_array($messages)) {
             $this->instance->merge($messages);
         }
     }
     return $this->instance;
 }
开发者ID:FUEL-dev-co,项目名称:boilerplate,代码行数:22,代码来源:Messages.php

示例11: getCart

 /**
  * Get the cart.
  *
  * @return Cart
  */
 public function getCart()
 {
     if ($this->session->has('cart')) {
         return $this->session->get('cart');
     }
     return $this->cart;
 }
开发者ID:JimiOhrid,项目名称:shopStore,代码行数:12,代码来源:CartController.php

示例12: prepareAndGet

 /**
  * Prepare and get the alert collection.
  *
  * Here we make sure that the alerts collection is in the session
  * store. If it's not, then we will go ahead an create a new one
  *
  * @return Collection
  */
 protected function prepareAndGet()
 {
     if (!$this->session->has('chromabits.alerts')) {
         $this->session->set('chromabits.alerts', new Collection());
     }
     return $this->session->get('chromabits.alerts');
 }
开发者ID:MarkVaughn,项目名称:illuminated,代码行数:15,代码来源:AlertManager.php

示例13: __construct

 public function __construct($config = [], SessionStore $session)
 {
     if (is_array($config['ttwitter::config'])) {
         $this->tconfig = $config['ttwitter::config'];
     } else {
         if (is_array($config['ttwitter'])) {
             $this->tconfig = $config['ttwitter'];
         } else {
             throw new Exception('No config found');
         }
     }
     $this->debug = isset($this->tconfig['debug']) && $this->tconfig['debug'] ? true : false;
     $this->parent_config = [];
     $this->parent_config['consumer_key'] = $this->tconfig['CONSUMER_KEY'];
     $this->parent_config['consumer_secret'] = $this->tconfig['CONSUMER_SECRET'];
     $this->parent_config['token'] = $this->tconfig['ACCESS_TOKEN'];
     $this->parent_config['secret'] = $this->tconfig['ACCESS_TOKEN_SECRET'];
     if ($session->has('access_token')) {
         $access_token = $session->get('access_token');
         if (is_array($access_token) && isset($access_token['oauth_token']) && isset($access_token['oauth_token_secret']) && !empty($access_token['oauth_token']) && !empty($access_token['oauth_token_secret'])) {
             $this->parent_config['token'] = $access_token['oauth_token'];
             $this->parent_config['secret'] = $access_token['oauth_token_secret'];
         }
     }
     $this->parent_config['use_ssl'] = $this->tconfig['USE_SSL'];
     $this->parent_config['user_agent'] = 'LTTW ' . parent::VERSION;
     $config = array_merge($this->parent_config, $this->tconfig);
     parent::__construct($this->parent_config);
 }
开发者ID:nWidart,项目名称:twitter,代码行数:29,代码来源:Twitter.php

示例14: __construct

 public function __construct(Store $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:sharenjoy,项目名称:cmsharenjoy,代码行数:8,代码来源:FlashMessageBag.php

示例15: __construct

 /**
  * Class constructor.
  *
  * @param Illuminate\Html\FormBuilder $builder
  * @param Illuminate\Http\Request     $request
  * @param Illuminate\Session\Store    $session
  */
 public function __construct(Builder $builder, Request $request, Session $session)
 {
     $this->builder = $builder;
     $this->request = $request;
     $this->fields = new FieldCollection();
     $this->fields->setNamespace($this->namespace);
     $this->fields->setBuilder($this->builder);
     $this->fields->setErrorBag($session->has('errors') ? $session->get('errors')->getBag($this->namespace) : new MessageBag());
 }
开发者ID:ruysu,项目名称:laravel4-form,代码行数:16,代码来源:FormBuilder.php


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