javascript - Lankit Datatables Bundle in Symfony2 -


i have little problem backoffice implementation symfony, want print info in different tables , want filter them datatables system. code when go view info printed doens't print , give me 500 error, thead , tfoot prints tbody doens't.

here code:

routing:

backoffice_view:     path: /backoffice/table     defaults: { _controller: apibundle:api:view }  backoffice_table_info:     path: /backoffice/table/info     defaults: { _controller: apibundle:api:table }     requirements:         _method: 

controller:

public function tableaction() {      $datatable = $this->get('lankit_datatables')->getdatatable('apibundle:entity');      return $datatable->getsearchresults();   }  public function viewaction() {      return $this->render('apibundle:api:table.html.twig', array(      ));  } 

javascript table (i code filter in each column):

$('#table tfoot th').each( function () {      var title = $(this).text();      $(this).html( '<input type="text" placeholder="busca en '+title+'" />' );  } );  var tablas = $('#table').datatable( {     "language": {             "aria": {                 "sortascending": ": activate sort column ascending",                 "sortdescending": ": activate sort column descending"          },          "emptytable": "no data available in table",          "info": "showing _start_ _end_ of _total_ records",          "infoempty": "no records found",          "infofiltered": "(filtered1 _max_ total records)",          "lengthmenu": "show _menu_",          "search": "search:",          "zerorecords": "no matching records found",          "paginate": {              "previous":"prev",              "next": "next",              "last": "last",              "first": "first"          }     },      "spaginationtype": "full_numbers",     "processing": true,     "serverside": true,     "sajaxsource": "../table/info",      "aocolumns": [         { "mdata": "data1"},         { "mdata": "data2"},         { "mdata": "data3"},         { "mdata": "data4"},         { "mdata": "data5"},         { "mdata": "data6"}     ],      "lengthmenu": [         [5, 15, 20, -1],         [5, 15, 20, "all"] // change per page values here     ],     // set initial value     "pagelength": 15,                 "pagingtype": "bootstrap_full_number",     "order": [         [2, "asc"]     ] // set first column default sort asc  });  // apply search tablas.columns().every( function () {     var = this;     $( 'input', this.footer() ).on( 'keyup change', function () {         if ( that.search() !== this.value ) {                             .search( this.value )                 .draw();         }     } ); } ); 

twig:

<table class="table table-striped table-bordered table-hover table-checkable order-column table-header-fixed" id="table">     <thead>         <tr>             <th>data1</th>             <th>data2</th>             <th>data3</th>             <th>data4</th>             <th>data5</th>        </tr>     </thead>     <tfoot>        <tr>            <th>data1</th>            <th>data2</th>            <th>data3</th>            <th>data4</th>            <th>data5</th>        </tr>     </tfoot>     <tbody>        <tr>         </tr>     </tbody> </table> 

i don't know if it's problem need special repository entity or javascript code.

thanks in advance answers :) carl

edit: apache error log:

[thu jul 28 13:29:38.560587 2016] [:error] [pid 8624:tid 1880] [client   ::1:60679] php fatal error: class  'symfony\\component\\httpkernel\\eventlistener\\savesessionlistener' not found in c:\\xampp\\htdocs\\api\\app\\cache\\prod\\classes.php on line 1837, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561087 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php fatal error: class 'symfony\\component\\httpkernel\\eventlistener\\savesessionlistener' not found in c:\\xampp\\htdocs\\api\\app\\cache\\prod\\classes.php on line 1837, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561087 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php stack trace:, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561087 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php stack trace:, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561087 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php 1. {main}() c:\\xampp\\htdocs\\api\\web\\app.php:0, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561087 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 1. {main}() c:\\xampp\\htdocs\\api\\web\\app.php:0, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561587 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 2. symfony\\component\\httpkernel\\kernel->handle() c:\\xampp\\htdocs\\api\\web\\app.php:27, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561587 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php 2. symfony\\component\\httpkernel\\kernel->handle() c:\\xampp\\htdocs\\api\\web\\app.php:27, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561587 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 3. symfony\\component\\httpkernel\\kernel->gethttpkernel() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2336, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561587 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php 3. symfony\\component\\httpkernel\\kernel->gethttpkernel() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2336, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561587 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 4. symfony\\component\\dependencyinjection\\container->get() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2340, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561587 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php 4. symfony\\component\\dependencyinjection\\container->get() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2340, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561587 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 5. appprodprojectcontainer->gethttpkernelservice() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2062, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.561587 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php 5. appprodprojectcontainer->gethttpkernelservice() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2062, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.562087 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 6. symfony\\component\\dependencyinjection\\container->get() c:\\xampp\\htdocs\\api\\app\\cache\\prod\\appprodprojectcontainer.php:657, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.562087 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 7. appprodprojectcontainer->geteventdispatcherservice() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2062, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.562087 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php 6. symfony\\component\\dependencyinjection\\container->get() c:\\xampp\\htdocs\\api\\app\\cache\\prod\\appprodprojectcontainer.php:657, referer: http://localhost/api/web/app_dev.php/backoffice/table [thu jul 28 13:29:38.562087 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 8. symfony\\component\\eventdispatcher\\containerawareeventdispatcher->addsubscriberservice() c:\\xampp\\htdocs\\api\\app\\cache\\prod\\appprodprojectcontainer.php:425, referer: http://localhost/api/web/app_dev.php/backoffice/historial [thu jul 28 13:29:38.562087 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php 7. appprodprojectcontainer->geteventdispatcherservice() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2062, referer: http://localhost/api/web/app_dev.php/backoffice/historial [thu jul 28 13:29:38.562087 2016] [:error] [pid 8624:tid 1880] [client ::1:60679] php 8. symfony\\component\\eventdispatcher\\containerawareeventdispatcher->addsubscriberservice() c:\\xampp\\htdocs\\api\\app\\cache\\prod\\appprodprojectcontainer.php:425, referer: http://localhost/api/web/app_dev.php/backoffice/historial [thu jul 28 13:29:39.022904 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php fatal error: class 'symfony\\component\\httpkernel\\eventlistener\\savesessionlistener' not found in c:\\xampp\\htdocs\\api\\app\\cache\\prod\\classes.php on line 1837, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.022904 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php stack trace:, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.023406 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 1. {main}() c:\\xampp\\htdocs\\api\\web\\app.php:0, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.023406 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 2. symfony\\component\\httpkernel\\kernel->handle() c:\\xampp\\htdocs\\api\\web\\app.php:27, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.023406 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 3. symfony\\component\\httpkernel\\kernel->gethttpkernel() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2336, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.023906 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 4. symfony\\component\\dependencyinjection\\container->get() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2340, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.023906 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 5. appprodprojectcontainer->gethttpkernelservice() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2062, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.023906 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 6. symfony\\component\\dependencyinjection\\container->get() c:\\xampp\\htdocs\\api\\app\\cache\\prod\\appprodprojectcontainer.php:657, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.024407 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 7. appprodprojectcontainer->geteventdispatcherservice() c:\\xampp\\htdocs\\api\\app\\bootstrap.php.cache:2062, referer: http://localhost/api/web/metronic/css/plugins-md.min.css [thu jul 28 13:29:39.024407 2016] [:error] [pid 8624:tid 1864] [client ::1:60685] php 8. symfony\\component\\eventdispatcher\\containerawareeventdispatcher->addsubscriberservice() c:\\xampp\\htdocs\\api\\app\\cache\\prod\\appprodprojectcontainer.php:425, referer: http://localhost/api/web/metronic/css/plugins-md.min.css 

the problem is: when pass entity in controller doens't respond me , think it's problem serializer.

i found posible solution comenting in database.php bundle in line 359

//$fieldname = container::camelize($fieldname); 

it worked , prints , filter inside table.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -