• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Session\Store类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: index

 /**
  * @param AccountManager $manager
  * @param Store $session
  * @return \Illuminate\Contracts\View\View
  * @throws \Exception
  */
 public function index(AccountManager $manager, Store $session)
 {
     $account = $manager->account();
     $contact = $account->contactInformation->first();
     $success = $session->get('success');
     return $this->theme->render('contact.' . $this->theme->setting('contactLayout'), ['contact' => $contact, 'success' => $success]);
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:13,代码来源:ContactController.php


示例2: testOldInputOrWithoutOldInput

 /**
  * Should give the fallback string when old input is not present.
  */
 public function testOldInputOrWithoutOldInput()
 {
     $fieldName = $this->generator()->anyString();
     $this->sessionStore->shouldReceive('getOldInput')->andReturn([$fieldName => []]);
     $fallbackValue = $this->generator()->anyString();
     $this->assertSame($fallbackValue, $this->replyComposer->oldInputOr($fieldName, $fallbackValue));
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:10,代码来源:ReplyComposerTest.php


示例3: handle

 /**
  * Handle the event.
  */
 public function handle(Store $session)
 {
     /* @var MessageBag $errors */
     if ($errors = $session->get($this->builder->getOption('prefix') . 'errors')) {
         $this->builder->setFormErrors($errors);
     }
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:10,代码来源:LoadFormErrors.php


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


示例5: oldInput

 /**
  * @return MessageBag
  */
 private function oldInput()
 {
     if (!isset($this->oldInput)) {
         $this->oldInput = new MessageBag((array) $this->sessionStore->getOldInput());
     }
     return $this->oldInput;
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:10,代码来源:ReplyComposer.php


示例6: handle

 /**
  * Handle the event.
  *
  * @param Store $session
  */
 public function handle(Store $session)
 {
     /* @var FieldType $field */
     foreach ($this->builder->getFormFields() as $field) {
         $session->flash($field->getFieldName(), $field->getPostValue());
     }
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:12,代码来源:FlashFieldValues.php


示例7: flash

 /**
  * Store the messages in the current session.
  */
 public function flash()
 {
     if (static::$session) {
         static::$session->flash($this->getSessionKey(), $this);
     }
     return $this;
 }
开发者ID:iyoworks,项目名称:support,代码行数:10,代码来源:AlertBag.php


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


示例9: locale

 /**
  * @param Store $session
  * @param Request $request
  * @param AccountManager $accounts
  * @return \Illuminate\Http\RedirectResponse
  */
 public function locale(Store $session, Request $request, AccountManager $accounts)
 {
     $account = $accounts->account();
     if ($request->has('locale') && $this->is_account_locale($account, $request->get('locale'))) {
         $session->set('locale', $request->get('locale'));
         return redirect()->to('/' . $request->get('locale'));
     }
     return redirect()->to(store_route('store.home'));
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:15,代码来源:SystemController.php


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


示例11: authenticate

 /**
  * Authenticate to a protected snippet.
  *
  * @param Url                       $url
  * @param \Illuminate\Http\Request  $request
  * @param \Illuminate\Session\Store $session
  * @return \Illuminate\Http\RedirectResponse
  */
 public function authenticate(Url $url, Request $request, Store $session)
 {
     if (!$url->authenticate($request->input('password'))) {
         flash()->warning('Wrong password');
         return redirect()->back();
     }
     $session->flash('urls_auth', true);
     return redirect()->route('urls.show', $url->slug->slug);
 }
开发者ID:elvios,项目名称:darkshare,代码行数:17,代码来源:UrlsController.php


示例12: __construct

 /**
  * 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');
 }
开发者ID:jarnstedt,项目名称:former,代码行数:18,代码来源:Former.php


示例13: makeResponse

 protected function makeResponse(Request $request)
 {
     $message = $this->translator->get('c::auth.login-required');
     if ($request->ajax() || $request->isJson() || $request->wantsJson()) {
         return Response::json(['error' => $message], 403);
     } else {
         $url = $this->url->action('anlutro\\Core\\Web\\AuthController@login');
         $intended = $request->getMethod() == 'GET' ? $request->fullUrl() : ($request->header('referer') ?: '/');
         $this->session->put('url.intended', $intended);
         return $this->redirect->to($url)->with('error', $message);
     }
 }
开发者ID:anlutro,项目名称:l4-core,代码行数:12,代码来源:AuthFilter.php


示例14: validate

 /**
  * Validate what is passed into the age gate
  *
  * @param array $data
  * @return $this|Validation|\Illuminate\Http\RedirectResponse
  */
 public function validate(array $data)
 {
     $this->validation = $this->validator->make($data, $this->getValidationRules(), $this->getValidationMessages());
     if ($this->validation->fails()) {
         $failed = $this->validation->failed();
         $validExceptTooYoung = array_get($failed, 'dob.Before');
         $canTryAgain = config('laravel-avp.can_try_again');
         $toRedirect = config('laravel-avp.redirect_on_error');
         $redirectURL = config('laravel-avp.redirect_url');
         if (substr($data['dob'], 0, 4) > date('Y')) {
             return redirect()->action('AVPController@agegate')->withErrors($this->validation->messages())->withInput();
         } else {
             if ($validExceptTooYoung && $toRedirect) {
                 return redirect($redirectURL);
             } else {
                 if ($validExceptTooYoung && !$canTryAgain) {
                     $this->session->put('laravel-avp.previous_too_young', true);
                 } else {
                     $this->session->keep('url.intended');
                 }
             }
         }
         return redirect()->action('AVPController@agegate')->withErrors($this->validation->messages())->withInput();
     }
     return $this->setCookie($data['remember']);
 }
开发者ID:fastwebmedia,项目名称:laravel-avp,代码行数:32,代码来源:Validation.php


示例15: handle

 /**
  * Handle the event.
  */
 public function handle()
 {
     if (!$this->config->get('app.debug') && !$this->session->get(__CLASS__ . 'warned') && $this->request->path() == 'admin/dashboard' && $this->modules->get('anomaly.module.installer')) {
         $this->session->set(__CLASS__ . 'warned', true);
         $this->messages->error('streams::message.delete_installer');
     }
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:10,代码来源:CheckIfInstallerExists.php


示例16: getUser

 public function getUser()
 {
     if ($this->user == false) {
         $this->user = $this->session->get("sharp_user");
     }
     return $this->user;
 }
开发者ID:dvlpp,项目名称:sharp,代码行数:7,代码来源:SharpAuth.php


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


示例18: message

 /**
  * Setup the flash messsage data.
  *
  * @param string $message
  * @param string $title
  * @param string $level
  */
 protected function message($message, $title = '', $type = 'info')
 {
     $this->message = $message;
     $this->title = $title;
     $this->type = $type;
     $this->session->flash($this->namespace, (array) $this);
 }
开发者ID:willishq,项目名称:laravel5-flash,代码行数:14,代码来源:Flash.php


示例19: handleDetectionComplete

 /**
  * This is what happens, wenn the detection passes
  *
  * @param $lookup
  *
  * @return mixed
  */
 protected function handleDetectionComplete($lookup)
 {
     debugger()->info('Language detected: ' . $this->detected->slug);
     Cookie::queue($this->keys['cookie'], $this->detected->slug);
     $this->session->set($this->keys['session'], $this->detected->slug);
     $this->config->set('app.locale', $this->detected->slug);
     return $this->detected;
 }
开发者ID:wegnermedia,项目名称:melon,代码行数:15,代码来源:CurrentLanguageDetector.php


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Support\Arr类代码示例发布时间:2022-05-23
下一篇:
PHP Session\SessionManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap