简体   繁体   中英

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 ?

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 :( ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM