当前位置: 首页>>代码示例>>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;未经允许,请勿转载。