當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SessionManager::flash方法代碼示例

本文整理匯總了PHP中Illuminate\Session\SessionManager::flash方法的典型用法代碼示例。如果您正苦於以下問題:PHP SessionManager::flash方法的具體用法?PHP SessionManager::flash怎麽用?PHP SessionManager::flash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Session\SessionManager的用法示例。


在下文中一共展示了SessionManager::flash方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handle

 public function handle($request, \Closure $next)
 {
     $response = $next($request);
     if (!empty($flashMessages = $this->messageManager->getFlash())) {
         $this->sessionManager->flash('flash_messages', $flashMessages);
     }
     return $response;
 }
開發者ID:marius321967,項目名稱:laravel-messages,代碼行數:8,代碼來源:StoreFlashMessages.php

示例2: add

 /**
  * Add notification.
  *
  * @param $type
  * @param $message
  * @param null  $title
  * @param array $options
  *
  * @return bool
  */
 public function add($type, $message, $title = null, $options = [])
 {
     $types = ['info', 'warning', 'success', 'error'];
     if (!in_array($type, $types)) {
         return false;
     }
     $this->notifications[] = ['type' => $type, 'title' => $title, 'message' => $message, 'options' => $options];
     $this->session->flash('toastr:notifications', $this->notifications);
 }
開發者ID:yuansir,項目名稱:toastr-for-laravel5,代碼行數:19,代碼來源:Toastr.php

示例3: add

 /**
  *
  * Add a flash message to session.
  *
  * @param string $type Must be one of info, success, warning, error.
  * @param string $message The flash message content.
  * @param string $title The flash message title.
  * @param array  $options The custom options.
  *
  * @return void
  */
 public function add($type, $message, $title = null, $options = [])
 {
     $types = ['error', 'info', 'success', 'warning'];
     if (!in_array($type, $types)) {
         throw new Exception("The {$type} remind message is not valid.");
     }
     $this->messages[] = ['type' => $type, 'title' => $title, 'message' => $message, 'options' => $options];
     $this->session->flash('toastr::messages', $this->messages);
 }
開發者ID:whossun,項目名稱:laravel-toastr,代碼行數:20,代碼來源:Toastr.php

示例4: install

 public function install(Request $request, PluginHandler $handler, PluginProvider $provider, ComposerFileWriter $writer, SessionManager $session)
 {
     $id = $request->get('pluginId');
     $handler->getAllPlugins(true);
     if ($handler->getPlugin($id) !== null) {
         throw new HttpException(422, 'Plugin already installed.');
     }
     // 자료실에서 플러그인 정보 조회
     $pluginData = $provider->find($id);
     if ($pluginData === null) {
         throw new HttpException(422, "Can not find the plugin(" . $id . ") that should be installed from the Market-place.");
     }
     $title = $pluginData->title;
     $name = $pluginData->name;
     $version = $pluginData->latest_release->version;
     $operation = $handler->getOperation($writer);
     if ($operation['status'] === ComposerFileWriter::STATUS_RUNNING) {
         throw new HttpException(422, "이미 진행중인 요청이 있습니다.");
     }
     $timeLimit = config('xe.plugin.operation.time_limit');
     $writer->reset()->cleanOperation();
     $writer->install($name, $version, Carbon::now()->addSeconds($timeLimit)->toDateTimeString())->write();
     $this->reserveOperation($writer, $timeLimit);
     $session->flash('alert', ['type' => 'success', 'message' => '새로운 플러그인을 설치중입니다.']);
     return XePresenter::makeApi(['type' => 'success', 'message' => '새로운 플러그인을 설치중입니다.']);
 }
開發者ID:xpressengine,項目名稱:xpressengine,代碼行數:26,代碼來源:PluginController.php

示例5: add

 /**
  * Add a notification
  *
  * @param string $type Could be error, info, success, or warning.
  * @param string $message The notification's message
  * @param string $title The notification's title
  *
  * @return bool Returns whether the notification was successfully added or 
  * not.
  */
 public function add($type, $message, $title = null, $options = array())
 {
     $allowedTypes = array('error', 'info', 'success', 'warning');
     if (!in_array($type, $allowedTypes)) {
         return false;
     }
     $this->notifications[] = array('type' => $type, 'title' => $title, 'message' => $message, 'options' => $options);
     $this->session->flash('toastr::notifications', $this->notifications);
 }
開發者ID:kamaln7,項目名稱:toastr,代碼行數:19,代碼來源:Toastr.php

示例6: setFlash

 /**
  * Write all alerts to session flash
  */
 public function setFlash()
 {
     $flash = array();
     foreach ($this->bag->getMessages() as $type => $messages) {
         foreach ($messages as $message) {
             $flash[$type][] = $message;
         }
     }
     $this->session->flash(self::SESSION_KEY, $flash);
 }
開發者ID:creolab,項目名稱:alert,代碼行數:13,代碼來源:Environment.php

示例7: destroy

 /**
  * Removes the specified item from storage.
  *
  * @param string $model Model to use.
  * @param int $id Item ID.
  * @return \Illuminate\Http\Response
  */
 public function destroy($model, $id)
 {
     $this->setModel($model);
     $this->checkAction('destroy');
     $item = $this->staticModelFind($id);
     if (!$item) {
         abort(404);
     }
     $item->deleteWithRelations();
     $this->session->flash('msg', trans('lavanda::common.success_destroy'));
     return $this->getRoute('index');
 }
開發者ID:idealogica,項目名稱:lavanda,代碼行數:19,代碼來源:EntityController.php

示例8: store

 public function store(Request $request, WidgetBoxHandler $handler, SessionManager $session)
 {
     if (!$request->user()->isAdmin()) {
         throw new AccessDeniedHttpException();
     }
     $this->validate($request, ['id' => 'required', 'title' => 'required']);
     $inputs = $request->only(['id', 'title']);
     $widgetbox = $handler->find($inputs['id']);
     if ($widgetbox) {
         throw new IDAlreadyExistsException();
     }
     $widgetbox = $handler->create($inputs);
     $session->flash('alert', ['type' => 'success', 'message' => '위젯박스가 생성되었습니다.']);
     return XePresenter::makeApi(['type' => 'success', 'message' => '생성했습니다.']);
 }
開發者ID:xpressengine,項目名稱:xpressengine,代碼行數:15,代碼來源:WidgetBoxController.php

示例9: postIndex

 /**
  * Show the login form
  *
  * @return mixed
  */
 public function postIndex()
 {
     // Pick up the honeypot field to stop bots, return to the login screen, no message
     if ($this->request->get('potter')) {
         return $this->redirect->to('auth/login')->withInput();
     }
     if (!$this->validator->with($this->request->all())->passes()) {
         return $this->redirect->to('auth/login')->withErrors($this->validator->errors());
     }
     if ($this->auth->attempt(['username' => $this->request->get('username'), 'password' => $this->request->get('password')])) {
         return $this->redirect->intended('/');
     }
     $this->session->flash('failed', trans('auth.incorrect_username_or_password'));
     return $this->redirect->to('auth/login')->withInput();
 }
開發者ID:jraymundoyrockdev,項目名稱:api-gfccm-systems,代碼行數:20,代碼來源:AuthController.php

示例10: add

 /**
  * Add a new notification to the session
  *
  * @param  string $type
  * @param  string $message
  * @param  null   $title
  * @return void
  */
 public function add($type, $message, $title = null)
 {
     $notifications = $this->getNotifications();
     $notifications[] = ['type' => $type, 'message' => $message, 'title' => $title];
     $this->session->flash(self::SESSION_KEY, $notifications);
 }
開發者ID:Crinsane,項目名稱:LaravelNotify,代碼行數:14,代碼來源:Notification.php


注:本文中的Illuminate\Session\SessionManager::flash方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。