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


PHP Alert::flash方法代碼示例

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


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

示例1: saveSettings

 public function saveSettings()
 {
     $data = Input::all();
     $profile = new Profile();
     $profile->deleteMyEmailNotifications(Auth::id());
     $profile->saveMyEmailNotifications(Auth::id(), $data);
     return Alert::flash(Lang::get('auth.settings-updated'), 'success');
 }
開發者ID:anthrotech,項目名稱:laravel_sample,代碼行數:8,代碼來源:SettingsController.php

示例2: thumbsUp

 public function thumbsUp($id, $slug)
 {
     $post = Post::where('id', $id)->where('slug', $slug)->with('user.profile')->firstOrFail();
     if (!Vote::setVotePoints($post)) {
         return Alert::flash(Lang::get('post.vote'), 'warning');
     }
     return Redirect::action('post', [$id, $slug]);
 }
開發者ID:anthrotech,項目名稱:laravel_sample,代碼行數:8,代碼來源:PostController.php

示例3: send

 public function send()
 {
     $data = Input::all();
     $rules = ['full_name' => ['required', 'min:3', 'max:35'], 'email' => ['required', 'email'], 'content' => ['required', 'min:10', 'max:600']];
     $validator = Validator::make($data, $rules);
     if ($validator->fails()) {
         return Alert::formError($validator);
     }
     Mailing::contact($data);
     return Alert::flash(Lang::get('contact.sent'), 'success');
 }
開發者ID:anthrotech,項目名稱:laravel_sample,代碼行數:11,代碼來源:ContactController.php

示例4: displayForm

 private function displayForm($type)
 {
     $title = "Post Comment";
     $currentQuestion = Question::getCurrentQuestion();
     $points_pct = Question::getTotalPointsPct($currentQuestion);
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $posts = Post::getRandPosts($currentQuestion);
     if (Post::hasPost($currentQuestion)) {
         return Alert::flash(Lang::get('post.exist'), 'warning');
     }
     $options = [$currentQuestion['left_option'] => ucfirst($currentQuestion['left_option']), $currentQuestion['right_option'] => ucfirst($currentQuestion['right_option'])];
     return View::make("posts.options.{$type}")->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'points_pct' => $points_pct, 'posts' => $posts, 'options' => $options, 'title' => $title]);
 }
開發者ID:anthrotech,項目名稱:laravel_sample,代碼行數:13,代碼來源:PostOptionController.php

示例5: adminUpdateUser

 public static function adminUpdateUser($id)
 {
     $data = Input::all();
     $rules = ['email' => ['required', 'email', 'max:128', 'unique:users,email,' . Auth::id()], 'username' => ['required', 'min:5', 'max:15', 'alpha_num', 'unique:users,username,' . Auth::id()]];
     $validator = Validator::make($data, $rules);
     if ($validator->fails()) {
         return Alert::formError($validator);
     } else {
         $user = new User();
         $update = User::UpdateUser($id, $data);
         return Alert::flash(Lang::get('admin.user-updated'), 'success');
     }
 }
開發者ID:anthrotech,項目名稱:laravel_sample,代碼行數:13,代碼來源:ProfileController.php

示例6: passwordUpdate

 public function passwordUpdate()
 {
     $data = Input::only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($data, function ($user, $password) {
         $user->password = $password;
         $user->save();
     });
     switch ($response) {
         case Password::INVALID_PASSWORD:
         case Password::INVALID_TOKEN:
         case Password::INVALID_USER:
             return Alert::flash(Lang::get($response), 'error');
         case Password::PASSWORD_RESET:
             return Alert::flash(Lang::get('reminders.reset'), 'success');
     }
 }
開發者ID:anthrotech,項目名稱:laravel_sample,代碼行數:16,代碼來源:UserController.php


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