2017 © Pedro Peláez
 

symfony-bundle data-grid-bundle

Data grid bundle for ano/data-grid

image

ano/data-grid-bundle

Data grid bundle for ano/data-grid

  • Monday, July 9, 2012
  • by Delendial
  • Repository
  • 1 Watchers
  • 3 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

AnoDataGridBundle

Installation

Usage

Building the grid

class DashboardController extends AdminController
{
    public function gridAction(Request $request, $page = 1, $pageSize = 10)
    {
        $factory = $this->getDataGridFactory();
        $grid = $factory->createBuilder('my_grid')
            ->addColumn('id', 'text', array(
                'label' => 'ID',
                'property_path' => 'id',
            ))
            ->addColumn('title', 'text', array(
                'label' => 'Title',
                'property_path' => 'title',
            ))
            ->addColumn('author', 'text', array(
                'label' => 'Author',
                'property_path' => 'author.name',
            ))
            ->addColumn('date', 'date', array(
                'label' => 'Released at',
                'property_path' => 'releasedAt',
            ))
            ->addColumn('price', 'money', array(
                'label' => 'Price',
                'property_path' => 'price',
            ))
            ->addColumn('edit', 'action', array(
                'label' => 'Edit',
                // 'callback' => function() {

                },
            ))
            ->getDataGrid()
        ;

        return $this->render('MyAdminBundle::grid.html.twig', array(
            'grid' => $grid->createView(),
        ));
    }

    /**
     * @return \Ano\DataGrid\DataGridFactoryInterface
     */
    public function getDataGridFactory()
    {
        return $this->get('ano_data_grid.data_grid.factory');
    }
}

Rendering the grid

{% data_grid_theme grid 'MyAdminBundle::grid_theme.html.twig' %}



{{ grid_head(grid) }} {{ grid_body(grid) }} {{ grid_foot(grid) }}

The Versions

09/07 2012

dev-master

9999999-dev

Data grid bundle for ano/data-grid

  Sources   Download

MIT

The Requires

 

The Development Requires

datagrid