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


PHP Question::getCurrentQuestion方法代码示例

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


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

示例1: postOptions

 public function postOptions()
 {
     $title = "Post";
     $currentQuestion = Question::getCurrentQuestion();
     $points_pct = Question::getTotalPointsPct($currentQuestion);
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $posts = Post::getRandPosts($currentQuestion);
     $leading_username = "BrewerBoy";
     $leading_votes = 30;
     return View::make('posts.options')->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'points_pct' => $points_pct, 'posts' => $posts, 'leading_username' => $leading_username, 'leading_votes' => $leading_votes, 'title' => $title]);
 }
开发者ID:anthrotech,项目名称:laravel_sample,代码行数:11,代码来源:PostController.php

示例2: showArchive

 public function showArchive($username)
 {
     $user = User::whereUsername($username)->firstOrFail();
     $profile = $user->profile()->first();
     $title = "My Archives";
     $currentQuestion = Question::getCurrentQuestion();
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $leading = Post::getLeadingBant($currentQuestion);
     $posts = $user->posts()->get();
     return View::make('profile.dashboard.archive')->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'leading' => $leading, 'profile' => $profile, 'user' => $user, 'posts' => $posts, 'title' => $title]);
 }
开发者ID:anthrotech,项目名称:laravel_sample,代码行数:11,代码来源:ArchiveController.php

示例3: index

 public function index()
 {
     $user = User::whereUsername(LoggedInUser::username())->firstOrFail();
     $profile = $user->profile()->first();
     $title = "My Settings";
     $email_notifications = Profile::getEmailNotifications();
     $email_user_settings = Profile::getMyEmailNotifications(Auth::id());
     $currentQuestion = Question::getCurrentQuestion();
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $leading = Post::getLeadingBant($currentQuestion);
     $posts = $user->posts()->get();
     return View::make('profile.dashboard.settings')->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'leading' => $leading, 'profile' => $profile, 'user' => $user, 'email_notifications' => $email_notifications, 'email_user_settings' => $email_user_settings, 'posts' => $posts, 'title' => $title]);
 }
开发者ID:anthrotech,项目名称:laravel_sample,代码行数:13,代码来源:SettingsController.php

示例4: processForm

 private function processForm($type, $data, $extra_rules)
 {
     $currentQuestion = Question::getCurrentQuestion();
     $rules = ['question' => ['required', "in:{$currentQuestion['id']}"], 'option' => ['required', "in:{$currentQuestion['left_option']},{$currentQuestion['right_option']}"], 'post_type' => ['required', "in:{$type}"], 'title' => ['required', "min:10", "max:200"]];
     foreach ($extra_rules as $field => $rule) {
         $rules[$field] = $rule;
     }
     $validator = Validator::make($data, $rules);
     if ($validator->fails()) {
         return Alert::formError($validator);
     }
     $post = new Post();
     $posted = $post->store($data, $type);
     return Redirect::route('post', [$posted['id'], $posted['slug']])->with('flash_success', Lang::get('post.saved'));
 }
开发者ID:anthrotech,项目名称:laravel_sample,代码行数:15,代码来源:PostOptionController.php

示例5: adminUser

 public static function adminUser($id)
 {
     $title = "User";
     $currentQuestion = Question::getCurrentQuestion();
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $leading = Post::getLeadingBant($currentQuestion);
     $get_user = User::getUser($id);
     return View::make('admin.users-show')->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'leading' => $leading, 'user' => $get_user, 'title' => $title]);
 }
开发者ID:anthrotech,项目名称:laravel_sample,代码行数:9,代码来源:ProfileController.php

示例6: index

 public function index()
 {
     $currentQuestion = Question::getCurrentQuestion();
     return View::make('home.index')->with(['question' => $currentQuestion]);
 }
开发者ID:anthrotech,项目名称:laravel_sample,代码行数:5,代码来源:HomeController.php


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