PHP function in jquery.dataTables.min.js

PHP function in jquery.dataTables.min.js

ZendieZendie Posts: 2Questions: 2Answers: 0

Hi all,

I have used DataTables for the pagination purpose in my project. I have language change in the same page. When I select "Spanish", the content of the page should be changed to Spanish. I couldn't use the PHP function in the jquery.dataTables.min.js page to convert the sentence "Showing 1 to 10 of 82 entries". I need to change here in the js file:
sInfo:"Showing START to END of TOTAL entries",

I need to call the PHP function like below:
sInfo:"<?php label('Showing');?> START <?php label('to');?> END of TOTAL <?php label('entries');?>",

Is there any way to do it?
Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 64,756Questions: 1Answers: 10,715 Site admin
    Answer ✓

    PHP will not run on the client-side, so you would need to make an Ajax call to the server simply to render the information message, every time it needs to be updated. That would be very inefficient.

    I'm not clear why you can't just use the language options in DataTables to do what you need?

    Allan

This discussion has been closed.