![]() |
How to pass parameters to lang from js? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: How to pass parameters to lang from js? (/showthread.php?tid=79104) |
How to pass parameters to lang from js? - sfarzoso - 04-20-2021 In one of my DataTable column I have this code: PHP Code: { I'm looking for a way to pass date and hour as lang parameter, infact in my localization I have this: PHP Code: 'published_on' => 'Published {0} on {1}', RE: How to pass parameters to lang from js? - includebeer - 04-20-2021 You can't do this like that. PHP run on the server, it send the final HTML document to the browser, then the JavaScript code run in the browser. So your JS code can't send parameter to a PHP function. RE: How to pass parameters to lang from js? - ojmichael - 04-20-2021 PHP Code: { This might work. It's not clear what format data.published_date is in. RE: How to pass parameters to lang from js? - sr13579 - 04-21-2021 I think you should use AJAX post method if you want to send something from JS to server. |