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


PHP Datatables::getHtmlBuilder方法代码示例

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


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

示例1: index

 /**
  * @param Request $request
  * @param Builder $htmlBuilder
  * @return $this This Index function include useless function like removeColumn , I wrote some method for show extra usage of datatable if
  * you want more complex datatable query please check the plugin's demo project. PLEASE READ DOCUMENTATION !!!
  * LINK =====> https://github.com/yajra/laravel-datatables-demo
  *
  * YAJRA DATATABLE PLUGINS ......
  */
 public function index(Datatables $datatables)
 {
     if ($this->currentUser->hasAccess('wts.user.show')) {
         if ($datatables->getRequest()->ajax()) {
             $users = DB::table('users')->select(['id', DB::raw("CONCAT(users.first_name,' ',users.last_name) as full_name"), 'slug', 'phone', 'password', 'email', 'created_at', 'updated_at']);
             return Datatables::of($users)->filterColumn('full_name', 'whereRaw', "CONCAT(users.first_name,' ',users.last_name) like ?", ["\$1"])->addColumn('action', function ($user) {
                 if ($this->currentUser->hasAccess('wts.user.edit')) {
                     $edit = $this->createEditButton('/admin/users/' . $user->slug . '/edit');
                 } else {
                     $edit = '';
                 }
                 if ($this->currentUser->hasAccess('wts.user.delete')) {
                     $delete = $this->createDeleteButton($user->id, 'admin.users.destroy');
                 } else {
                     $delete = '';
                 }
                 if ($this->currentUser->hasAccess('wts.user.show')) {
                     $use = '<a href="' . url("admin/users/") . "/" . $user->slug . '/use"
                             class="btn btn-warning" data-tooltip="true" title="Oturumu Kullan" ><i class="fa fa-user"></i></a>&nbsp;';
                 } else {
                     $use = '';
                 }
                 return $use . ' ' . $edit . ' ' . $delete;
             })->make(true);
         }
         $html = $datatables->getHtmlBuilder()->addColumn(['data' => 'full_name', 'name' => 'full_name', 'title' => 'Ad Soyad'])->addColumn(['data' => 'email', 'name' => 'email', 'title' => 'Email'])->addColumn(['data' => 'phone', 'name' => 'phone', 'title' => 'Telefon'])->addColumn(['data' => 'created_at', 'name' => 'created_at', 'title' => 'Created At'])->addColumn(['data' => 'updated_at', 'name' => 'updated_at', 'title' => 'Updated At'])->addColumn(['data' => 'action', 'name' => 'action', 'title' => 'İşlemler', 'orderable' => false, 'searchable' => false])->parameters(array('order' => [3, 'desc']));
         $data = ['menu' => 'users', 'page_title' => 'Kullanıcılar', 'page_description' => 'Sistem Kullanıcılara Ait Özellikler Bu Sayfada Yer Almaktadır'];
         return view('admin.user-group.user.index', $data)->with(compact('html'));
     } else {
         abort(403, $this->accessForbidden);
     }
 }
开发者ID:pinnaclesoftware,项目名称:Work-Tracking-System,代码行数:41,代码来源:UserController.php

示例2: index

 public function index(Datatables $datatables)
 {
     $columns = ['id', 'name', 'created_at'];
     if ($datatables->getRequest()->ajax()) {
         return $datatables->of(Client::select($columns))->make(true);
     }
     $html = $datatables->getHtmlBuilder()->columns($columns);
     return view('backend.admin.clients.index', compact('html'));
 }
开发者ID:retailone,项目名称:retailone,代码行数:9,代码来源:ClientController.php

示例3: show

 public function show(Datatables $datatables, $id)
 {
     $store = Store::findOrFail($id);
     $device = Device::findOrFail($id);
     if ($datatables->getRequest()->ajax()) {
         return $datatables->of(Visitor::select(['type', 'device_id', 'created_at'])->where('device_id', $device->id)->orderBy('created_at', 'desc'))->make(true);
     }
     $html = $datatables->getHtmlBuilder()->columns(['type', 'created_at']);
     return view('backend.admin.stores.show', compact('device', 'store', 'html'));
 }
开发者ID:retailone,项目名称:retailone,代码行数:10,代码来源:StoreController.php

示例4: getHtmlBuilder

 /**
  * Get html builder class.
  *
  * @return \Yajra\Datatables\Html\Builder 
  * @static 
  */
 public static function getHtmlBuilder()
 {
     return \Yajra\Datatables\Datatables::getHtmlBuilder();
 }
开发者ID:alexsynarchin,项目名称:Itnk5,代码行数:10,代码来源:_ide_helper.php

示例5: builder

 /**
  * Get Datatables Html Builder instance.
  *
  * @return \Yajra\Datatables\Html\Builder
  */
 public function builder()
 {
     return $this->datatables->getHtmlBuilder();
 }
开发者ID:rikardote,项目名称:agenda,代码行数:9,代码来源:DataTable.php


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