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


PHP DataGrid::source方法代碼示例

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


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

示例1: index

    /**
     * Display a listing of the resource.
     * GET /admcontinentes
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(new Continente());
        $filter->add('name_pt', 'Nome - PT', 'text');
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('name_pt', 'Nome PT', true);
        //field name, label, sortable
        $grid->add('
					<a class="" title="Modificar" href="admin/continente/{{$code}}/edit"><span class="glyphicon glyphicon-edit"> </span></a>
					', 'Ações');
        //$grid->edit('admin/hotel/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->orderBy('name_pt', 'desc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        // $hotel = Hotel::find(1);
        // echo $hotel->destino->{'nome_br'};
        // dd();
        return View::make('admin.continente.index', compact('filter', 'grid'));
    }
開發者ID:WillyMaciel,項目名稱:fwt,代碼行數:32,代碼來源:ADMContinentesController.php

示例2: all

 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Pessoas());
     $this->filter->add('nome', 'Nome', 'text');
     $this->filter->add('id_grupo', 'Grupo', 'text');
     $this->filter->add('id_programa', 'Programa', 'text');
     $this->filter->submit('buscar');
     $this->filter->reset('resetar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('nome', 'Nome');
     $this->grid->add('sexo', 'Sexo');
     $this->grid->add('nascimento', 'nascimento');
     $this->grid->add('responsavel', 'Responsável');
     $this->grid->add('email', 'Email');
     $this->grid->add('tel-fixo', 'Telefone Fixo');
     $this->grid->add('rua', 'Logradouro');
     $this->grid->add('numero', 'Numero');
     $this->grid->add('bairro', 'bairro');
     $this->grid->add('id_grupo', 'Grupo');
     $this->grid->add('id_programa', 'Programa');
     $this->addStylesToGrid();
     return $this->returnView();
 }
開發者ID:ronal2do,項目名稱:stq003,代碼行數:25,代碼來源:pessoasController.php

示例3: index

    /**
     * Display a listing of the resource.
     * GET /admpedido
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(new User());
        $filter->add('nome', 'Nome do Cliente', 'text');
        $filter->add('email', 'Email do Cliente', 'text');
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('id', 'Id Cliente', true);
        //field name, label, sortable
        $grid->add('nome', 'Nome do Cliente', true);
        //field name, label, sortable
        $grid->add('email', 'Email do Cliente');
        //relation.fieldname
        $grid->add('					
					<a class="" title="Criar Produtos" href="admin/produto-personalizado/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a>					
					', 'Ações');
        //$grid->edit('admin/serviconoturno/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->orderBy('id', 'desc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        return View::make('admin.produtopersonalizado.index', compact('filter', 'grid'));
    }
開發者ID:WillyMaciel,項目名稱:fwt,代碼行數:34,代碼來源:ADMProdutoPersonalizadoController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $filter = \DataFilter::source(User::with('faction'));
     $filter->add('name', 'Name', 'text');
     $filter->add('faction.name', 'Faction', 'autocomplete');
     $filter->add('updated_at', 'Last change', 'daterange')->format('m/d/Y', 'en');
     $filter->submit('search');
     $filter->reset('reset');
     $filter->build();
     $grid = \DataGrid::source($filter)->attributes(['class' => 'table table-hover table-striped']);
     $grid->add('id', 'ID', true)->cell(function ($value) {
         return link_to(action('Admin\\UserController@edit') . '?show=' . $value, $value);
     });
     $grid->add('status', 'Status', true);
     $grid->add('name', 'Name', true);
     $grid->add('faction.name', 'Faction', true);
     $grid->add('reputation', 'Reputation', true);
     $grid->add('alignment', 'Alignment', true);
     $grid->add('affiliation', 'Affiliation', true);
     $grid->add('created_at', 'Created', true);
     $grid->add('updated_at', 'Last change', true);
     $grid->add('email', 'Email address');
     $grid->edit(action('Admin\\UserController@edit'), 'Edit', 'modify|delete');
     return view('admin.user.index', compact('filter', 'grid'));
 }
開發者ID:stellargames,項目名稱:StellarDestiny,代碼行數:30,代碼來源:UserController.php

示例5: getIndex

 /**
  * Display a listing of destinos
  *
  * @return Response
  */
 public function getIndex()
 {
     $grid = DataGrid::source(new Destino());
     //same source types of DataSet
     $grid->add('nome_br', 'Nome PT', true);
     //field name, label, sortable
     $grid->add('nome_en', 'Nome EN');
     //relation.fieldname
     $grid->add('publicado', 'Publicado');
     $grid->edit('admin/destino/crud', 'Ações', 'show|modify|delete');
     //shortcut to link DataEdit actions
     $grid->link('admin/destino/crud', "Adicionar Novo", "TR");
     //add button
     $grid->orderBy('id', 'desc');
     //default orderby
     $grid->paginate(10);
     //pagination
     $grid->attributes(array('class' => 'table table-striped table-hover'));
     //Transforma TinyInteger de Publicado em Sim ou Não ao invez de 1 ou 0
     $grid->row(function ($row) {
         if ($row->cell('publicado')->value == 1) {
             $row->cell('publicado')->value = '<span class="label label-success"> Sim </span>';
         } else {
             $row->cell('publicado')->value = '<span class="label label-danger"> Não </span>';
         }
     });
     return View::make('admin.destino.index', compact('grid'));
 }
開發者ID:WillyMaciel,項目名稱:fwt,代碼行數:33,代碼來源:ADMDestinoController.php

示例6: index

    /**
     * Display a listing of mailings
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(new Mailing());
        $filter->add('email', 'Email', 'text');
        $filter->add('nome', 'Nome', 'text');
        $filter->add('phone', 'Telefone', 'text');
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('email', 'Email', true);
        //field name, label, sortable
        $grid->add('nome', 'Nome', true);
        //field name, label, sortable
        $grid->add('phone', 'Telefone', true);
        //field name, label, sortable
        $grid->add('
					<a class="text-danger" title="Deletar" href="admin/mailing/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a>
					', 'Ações');
        //$grid->edit('admin/mailing/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->orderBy('email', 'asc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        // $mailing = Mailing::find(1);
        // echo $mailing->destino->{'nome_br'};
        // dd();
        return View::make('admin.mailing.index', compact('filter', 'grid'));
    }
開發者ID:WillyMaciel,項目名稱:fwt,代碼行數:37,代碼來源:ADMMailingController.php

示例7: index

    /**
     * Display a listing of the resource.
     * GET /admpedido
     *
     * @return Response
     */
    public function index()
    {
        $filter = DataFilter::source(Pedido::with('cliente', 'status'));
        $filter->add('nome', 'Nome do Cliente', 'text');
        $filter->add('email', 'Email do Cliente', 'text');
        $filter->add('status.nome', 'Status do pedido', 'select')->options(PedidoStatus::lists("nome_br", "id"));
        $filter->submit('Filtrar');
        $filter->reset('Limpar Filtro');
        $filter->build();
        $grid = DataGrid::source($filter);
        //same source types of DataSet
        $grid->attributes(array("class" => "table table-striped table-hover"));
        $grid->add('id', 'Id Pedido', true);
        //field name, label, sortable
        $grid->add('nome', 'Nome do Cliente', true);
        //field name, label, sortable
        $grid->add('email', 'Email do Cliente');
        //relation.fieldname
        $grid->add('status.nome_br', 'Status do Pedido');
        //relation.fieldname
        $grid->add('total', 'Valor do Pedido');
        $grid->add('created_at', 'Data do Pedido', true);
        $grid->add('
					<a class="" title="Modificar" href="admin/pedido/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a>
					<a class="text-danger" title="Deletar" href="admin/pedido/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a>
					', 'Ações');
        //$grid->edit('admin/serviconoturno/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions
        $grid->orderBy('id', 'desc');
        //default orderby
        $grid->paginate(10);
        //pagination
        $grid->attributes(array('class' => 'table table-striped table-hover'));
        return View::make('admin.pedido.index', compact('filter', 'grid'));
    }
開發者ID:WillyMaciel,項目名稱:fwt,代碼行數:40,代碼來源:ADMPedidoController.php

示例8: view

 public function view()
 {
     $grid = DataGrid::source('categories');
     //same source types of DataSet
     $grid->add('name', 'Name', true);
     $grid->edit(route('adminCategoriesAddEdit'), 'Actions', 'modify|delete');
     return View::make('admin.categories', compact('grid'));
 }
開發者ID:ramialcheikh,項目名稱:onepathnetwork,代碼行數:8,代碼來源:AdminCategoriesController.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $grid = \DataGrid::source('api_keys');
     $grid->add('id', 'ID', true)->style('width:100px');
     $grid->add('name', 'Name', true);
     $grid->add('value', 'Value', true);
     $grid->add('<a href="' . route('apiKeys.index') . '/{{$id}}">View</a>', 'View');
     $grid->paginate(10);
     return view('apiKeys.index', compact('grid'));
 }
開發者ID:HeidiWang123,項目名稱:our-world-in-data-grapher,代碼行數:15,代碼來源:ApiKeysController.php

示例10: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $entities = Entity::all();
     $grid = \DataGrid::source('entities');
     $grid->add('id', 'ID', true)->style('width:100px');
     $grid->add('name', 'Name', true);
     $grid->add('<a href="' . route('entities.index') . '/{{$id}}">View</a>', 'View');
     $grid->add('<a href="' . route('entities.index') . '/{{$id}}/edit">Edit</a>', 'Edit');
     $grid->paginate(10);
     return view('entities.index', compact('grid'));
 }
開發者ID:HeidiWang123,項目名稱:our-world-in-data-grapher,代碼行數:16,代碼來源:EntitiesController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $grid = \DataGrid::source(new Product());
     $grid->add('id', 'ID', true)->style("width:100px");
     $grid->add('name', trans('main.name'), true);
     $grid->add('price', trans('main.price'), true);
     $grid->edit('products/edit', trans('main.edit'), 'show|modify|delete');
     $grid->link('dashboard/products/create', trans('main.new'), "TR");
     $grid->orderBy('id', 'desc');
     $grid->paginate(10);
     return view('dashboard.index', compact('grid'));
 }
開發者ID:holic-cl,項目名稱:aguas-algarrobo,代碼行數:17,代碼來源:ProductController.php

示例12: all

 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Grupo());
     $this->filter->add('nome', 'Name', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('nome', 'Name');
     $this->addStylesToGrid();
     return $this->returnView();
 }
開發者ID:ronal2do,項目名稱:stq001,代碼行數:13,代碼來源:GrupoController.php

示例13: all

 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Area());
     $this->filter->add('nombre', 'Nombre', 'text');
     $this->filter->submit('Buscar');
     $this->filter->reset('Limpiar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('nombre', 'Nombre');
     $this->addStylesToGrid();
     return $this->returnView();
 }
開發者ID:krusty,項目名稱:transparenciaCF,代碼行數:13,代碼來源:AreaController.php

示例14: all

 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Categoria());
     $this->filter->add('name', 'Nome', 'text');
     $this->filter->submit('buscar');
     $this->filter->reset('resetar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('id', 'ID');
     $this->grid->add('name', 'Nome');
     $this->addStylesToGrid();
     return $this->returnView();
 }
開發者ID:ronal2do,項目名稱:stq001,代碼行數:14,代碼來源:CategoriaController.php

示例15: all

 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Admins());
     $this->filter->add('first_name', 'Nome', 'text');
     $this->filter->submit('buscar');
     $this->filter->reset('resetar');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('first_name', 'Name');
     $this->grid->add('email', 'Email');
     $this->addStylesToGrid();
     return $this->returnView();
 }
開發者ID:ronal2do,項目名稱:stq001,代碼行數:14,代碼來源:AdminsController.php


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