PHP code example of renearias / arxis-datatables-bundle

1. Go to this page and download the library: Download renearias/arxis-datatables-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

renearias / arxis-datatables-bundle example snippets


    public function buildDatatable(array $options = array())
    {
        // ...

        $users = $this->em->getRepository('AppBundle:User')->findAll();

        $this->columnBuilder
            ->add('title', 'column', array(
                'title' => 'Title',
                'filter' => array('text', array(
                    'search_type' => 'eq'
                ))
            ))
            ->add('visible', 'boolean', array(
                'title' => 'Visible',
                'filter' => array('select', array(
                    'search_type' => 'eq',
                    'select_options' => array('' => 'All', '1' => 'Yes', '0' => 'No')
                )),
            ))
            ->add('createdby.username', 'column', array(
                'title' => 'Createdby User',
                'filter' => array('select', array(
                    'search_type' => 'eq',
                    'select_options' => array('' => 'All') + $this->getCollectionAsOptionsArray($users, 'username', 'username'),
                ))
            ))
            ->add('createdAt', 'datetime', array(
                'title' => 'Created',
                'filter' => array('daterange', array()),
            ))
        ;
    }