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


PHP Store::flash方法代码示例

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


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

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

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

示例3: flash

 /**
  * Set a session key and value.
  * 
  * @param  mixed $key
  * @param  string $data
  * 
  * @return mixed
  */
 public function flash($key, $data = null)
 {
     if (is_array($key)) {
         return $this->flashMany($key);
     }
     return $this->session->flash($key, $data);
 }
开发者ID:sepgg,项目名称:notify,代码行数:15,代码来源:Session.php

示例4: add

 public function add(array $message, $flash = true)
 {
     $this->messages->push($message);
     if ($flash) {
         $this->session->flash('__messages', $this->messages);
     }
     return $this;
 }
开发者ID:portonefive,项目名称:essentials,代码行数:8,代码来源:MessageManager.php

示例5: flash

 /**
  * Flash a message to the session.
  *
  * @param  string|array  $key
  * @param  mixed         $value
  */
 public function flash($key, $value = null)
 {
     if (is_array($key)) {
         $this->flashMany($key);
         return;
     }
     $this->session->flash($key, $value);
 }
开发者ID:arcanedev,项目名称:notify,代码行数:14,代码来源:Session.php

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

示例7: message

 /**
  * @param        $message
  * @param string $level
  */
 public function message($message, $level = 'info')
 {
     $notification = new \stdClass();
     $notification->message = $message;
     $notification->level = $level;
     $notifications = $this->session->get('flash_notifications', []);
     array_push($notifications, $notification);
     $this->session->flash('flash_notifications', $notifications);
 }
开发者ID:ahk-ch,项目名称:chamb.net,代码行数:13,代码来源:FlashNotifier.php

示例8: with

 /**
  * Flash a piece of data to the session.
  *
  * @param  string  $key
  * @param  mixed   $value
  * @return \Illuminate\Http\RedirectResponse
  */
 public function with($key, $value = null)
 {
     if (is_array($key)) {
         foreach ($key as $k => $v) {
             $this->with($k, $v);
         }
     } else {
         $this->session->flash($key, $value);
     }
     return $this;
 }
开发者ID:centaurustech,项目名称:sagip,代码行数:18,代码来源:RedirectResponse.php

示例9: add

 /**
  * Adds one or more messages
  *
  * @param string $group The name of the group to add the message(s) to
  * @param string|string[] $messages The message(s) to add to the specified group
  * @param bool $flash Whether to flash the message(s) for the next request
  *
  * @return void
  */
 public function add($group, $messages = '', $flash = false)
 {
     $messages = (array) $messages;
     if ($flash) {
         if (!isset($this->newFlashMessages[$group])) {
             $this->newFlashMessages[$group] = array();
         }
         $this->newFlashMessages[$group] = array_merge($this->newFlashMessages[$group], $messages);
         $this->store->flash($this->flashContainerName, $this->newFlashMessages);
     } else {
         if (!isset($this->messages[$group])) {
             $this->messages[$group] = array();
         }
         $this->messages[$group] = array_merge($this->messages[$group], $messages);
     }
 }
开发者ID:wibleh,项目名称:messagely,代码行数:25,代码来源:Messagely.php

示例10: message

 /**
  * Flash a general message.
  *
  * @param string $message
  * @param string $level
  * @param bool   $overlay
  *
  * @return $this
  */
 public function message($message, $level = 'info', $title = 'Notice', $overlay = false)
 {
     $messages = $this->session->pull('flash_notification.messages', []);
     $messages[] = compact('message', 'level', 'title', 'overlay');
     $this->session->flash('flash_notification.messages', $messages);
     return $this;
 }
开发者ID:phaza,项目名称:Laravel-Flash,代码行数:16,代码来源:FlashNotifier.php

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

示例12: getLogout

 /**
  * Logout
  *
  * If you're actually logged in, it'll log you out and show a message.
  * Else it will silently redirect you to the login form.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function getLogout()
 {
     if ($this->sentry->check()) {
         $this->sentry->logout();
         $this->session->flash('success', 'You have successfully logged out.');
     }
     return $this->redirect->route('larapress.home.login.get');
 }
开发者ID:LaraGit,项目名称:larapress,代码行数:16,代码来源:HomeController.php

示例13: redirectWithFlashMessage

 /**
  * Set a flash message and either redirect to a given route or the last page
  *
  * @param string $key The session flash message key
  * @param string $message The session flash message value
  * @param string|null $route The Route name to redirect to (can be left empty to just redirect back)
  * @param array $parameters Parameters for the route (See the Laravel documentation)
  * @param int $status Status code for the route (See the Laravel documentation)
  * @param array $headers Headers for the route (See the Laravel documentation)
  * @return \Illuminate\HTTP\RedirectResponse
  */
 public function redirectWithFlashMessage($key, $message, $route = null, $parameters = array(), $status = 302, $headers = array())
 {
     $this->session->flash($key, $message);
     if (!is_null($route)) {
         return $this->redirect->route($route, $parameters = array(), $status = 302, $headers = array());
     }
     return $this->redirect->back();
 }
开发者ID:LaraGit,项目名称:larapress,代码行数:19,代码来源:Helpers.php

示例14: with

 /**
  * Flash a piece of data to the session.
  *
  * @param  string  $key
  * @param  mixed   $value
  * @return \Illuminate\Http\RedirectResponse
  */
 public function with($key, $value = null)
 {
     $key = is_array($key) ? $key : [$key => $value];
     foreach ($key as $k => $v) {
         $this->session->flash($k, $v);
     }
     return $this;
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:15,代码来源:RedirectResponse.php

示例15: subscribeAction

 /**
  * Handle the subscription form request
  */
 public function subscribeAction()
 {
     try {
         $this->subscribeForm->validate($this->app->request()->params());
     } catch (FormValidationException $e) {
         $this->session->flash('message', 'Oh no, you have entered invalid data. Please correct your input and try again.');
         $this->session->flash('errors', $e->getErrors());
         $this->session->flash('input', $this->app->request()->params());
         $this->app->response->redirect($this->app->urlFor('home'));
         return;
     }
     //
     // TODO: Subscribe the client to your newsletter list... or stuff
     //
     $this->session->flash('message', 'Thanks for your request. You have successfully subscribed for our newsletter.');
     $this->app->response->redirect($this->app->urlFor('home'));
 }
开发者ID:seanc,项目名称:slim-boilerplate-1,代码行数:20,代码来源:HomeController.php


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