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


PHP Datatable::shouldHandle方法代碼示例

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


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

示例1: borrowList

 public function borrowList()
 {
     if (Datatable::shouldHandle()) {
         return Datatable::collection(Book::with('author')->orderBy('id', 'desc')->get())->showColumns('id', 'title', 'amount', 'stock')->addColumn('author', function ($model) {
             return $model->author->name;
         })->addColumn('borrow', function ($model) {
             $html = '<a href="' . route('books.borrow', $model->id) . '" class="btn btnn"> <i class="mdi-action-grade"></i> </a>';
             return $html;
         })->searchColumns('title', 'amount', 'author')->orderColumns('title', 'amount', 'author')->make();
     }
 }
開發者ID:ryanda,項目名稱:larapus,代碼行數:11,代碼來源:MemberController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Datatable::shouldHandle()) {
         $operator = Sentry::findAllUsersWithAccess('operator');
         $operatorCollection = new Illuminate\Database\Eloquent\Collection($operator);
         return Datatable::collection($operatorCollection)->addColumn('full_name', function ($model) {
             return $model->first_name . ' ' . $model->last_name;
         })->showColumns('id', 'email', 'last_login')->searchColumns('full_name', 'email', 'last_login')->orderColumns('full_name', 'email', 'last_login')->make();
     }
     return View::make('dashboard.admin.manageuser');
 }
開發者ID:antoniosai,項目名稱:daily-activity-management,代碼行數:16,代碼來源:Coba.php

示例3: index

 public function index()
 {
     $data = Author::all(['id', 'name']);
     if (Datatable::shouldHandle()) {
         return Datatable::collection($data)->showColumns('id', 'name')->addColumn('1', function ($model) {
             $html = '<a href="' . route('admin.authors.edit', $model->id) . '" class="btn btnn"> <i class="mdi-editor-mode-edit"></i> </a>';
             return $html;
         })->addColumn('2', function ($model) {
             $html = Form::open(['route' => ['admin.authors.destroy', $model->id], 'method' => 'delete']);
             $html .= '<button class="btn btnn" type="submit"> <i class="mdi-action-delete"></i> </button>';
             $html .= Form::close();
             return $html;
         })->searchColumns('name')->orderColumns('name')->make();
     }
     return View::make('authors.index')->withTitle('Penulis');
 }
開發者ID:ryanda,項目名稱:larapus,代碼行數:16,代碼來源:AuthorsController.php

示例4: index

 public function index()
 {
     if (Datatable::shouldHandle()) {
         return Datatable::collection(Book::with('author')->orderBy('id', 'desc')->get())->showColumns('id', 'title', 'amount')->addColumn('author', function ($model) {
             return $model->author->name;
         })->addColumn('1', function ($model) {
             $html = '<a href="' . route('admin.books.edit', $model->id) . '" class="btn btnn"> <i class="mdi-editor-mode-edit"></i> </a>';
             return $html;
         })->addColumn('2', function ($model) {
             $html = Form::open(['route' => ['admin.books.destroy', $model->id], 'method' => 'delete']);
             $html .= '<button class="btn btnn" type="submit"> <i class="mdi-action-delete"></i> </button>';
             $html .= Form::close();
             return $html;
         })->searchColumns('title', 'amount', 'author')->orderColumns('title', 'amount', 'author')->make();
     }
     return View::make('books.index')->withTitle('Buku');
 }
開發者ID:ryanda,項目名稱:larapus,代碼行數:17,代碼來源:BooksController.php


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