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


PHP Vote::get方法代碼示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //$votes = Response::json(Vote::all());
     $err = '';
     $votes = Vote::get();
     return View::make('tasks.index2', compact('votes', 'err'));
 }
開發者ID:sandy7772266,項目名稱:vote_1031,代碼行數:12,代碼來源:VoteController.php

示例2: array

// Route::get('t', 'CandidateController@create');
// Route::get('t2',  'CandidateController@store_a');
Route::get('excel', ['as' => 'import_cadidates', 'uses' => 'CandidateController@create']);
Route::get('excel_value', ['as' => 'import_cadidates_value', 'uses' => 'CandidateController@create']);
Route::get('store_a', ['as' => 'store_cadidates', 'uses' => 'CandidateController@store_a']);
//Route::get('/passsec/', ['as' => 'passsec', 'uses' => 'VoteController@passsec']);
Route::post('file_import', ['as' => 'file_import', 'uses' => 'CandidateController@file_move']);
Route::get('candidates_index', ['as' => 'cadidates', 'uses' => 'CandidateController@index']);
//Route::get('/', ['as' => 'home']);
Route::get('/{id}', array('as' => 'vote.edit', function ($id) {
    // return our view and Vote information
    return View::make('tasks.vote-edit')->with('vote', Vote::find($id));
}))->where('id', '[0-9]+');
Route::get('/manage', array('as' => 'manage', function () {
    $time_now = Carbon::now();
    $votes = Vote::get();
    $ary[0] = $votes;
    foreach ($ary[0] as $vote) {
        // $candidate = Candidate::find($vote->id);
        $candidate_c = Candidate::where('vote_id', '=', $vote->id)->first();
        if ($candidate_c != null) {
            $ary[1][$vote->id] = $candidate_c->vote_id;
        } else {
            $ary[1][$vote->id] = '沒有資料';
        }
    }
    // return our view and Vote information
    return View::make('tasks.vote-manage-index', compact('ary', 'time_now'));
}));
Route::get('/candidate_data_show/{id}', array('as' => 'candidate_data_show', function ($id) {
    $candidates = Candidate::where('vote_id', '=', $id)->get();
開發者ID:sandy7772266,項目名稱:vote_test6,代碼行數:31,代碼來源:routes.php


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