Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 - Sonata datagrid without entity

Is there a way to take advantage of the Sonata's Datagrid functionnality to display a resultset ?

class DefaultController extends Controller
{
    public function nl_listAction()
    {
        $obj = array();
        $cnx = $this->get('doctrine.dbal.a_connection');
        $cnx->query('CALL(a_procedure)');
        $obj['cnx'] = $cnx;
        return $this->render('GlideConfigBundle:Default:nl_list.html.twig', $obj);
    }
}

Here from a controller I'm calling a procedure and I'd like to display the resulting data using Datagrid.
Is it a good idea ?
How can I do it ?

like image 205
Pierre de LESPINAY Avatar asked Aug 09 '26 19:08

Pierre de LESPINAY


1 Answers

Ended up by using only the bootstrap table styles with my own templates/macros.
Also I had to kind of reinvent the wheel by doing filter widgets, list widgets, and pager :( ...

like image 144
Pierre de LESPINAY Avatar answered Aug 11 '26 10:08

Pierre de LESPINAY