agungsugiarto / boilerplate

CodeIgniter4 Boilerplate based on AdminLTE 3 with user management, roles, permissions, ...
MIT License
156 stars 49 forks source link

Replace route_to() with base_url() #73

Closed ixiDev closed 3 years ago

ixiDev commented 3 years ago

Hi. thanks for this awesome code 😄

After i install this library i got meany errors on datatable like this ;

DataTables warning: table id=table-user - Ajax error. For more information about this error, please see http://datatables.net/tn/7

So i search for the problem and i found its come from ajax script when you want to fill the DataTable

here is your code if file Views/*/index.php

.....
 ajax : {
            url: '<?= route_to('admin/role') ?>',
            method: 'GET'
        },
.....

I set app baseUrl in .env like this

app.baseURL = 'http://localhost/boilerplate/public/' and I am using Xampp the route_to() function always returned the link like this http://localhost/admin/role but i want it like this http://localhost/boilerplate/public/admin/role

so i replace route_to() with base_url() and i solve the problem , is it safe to do this ! Thanks again ❤️

agungsugiarto commented 3 years ago

Hello @ixiDev pr are welcome for fix this issue.

ixiDev commented 3 years ago

Hello @ixiDev pr are welcome for fix this issue.

Hi. I switched to Laragon and it's working perfectly 👌 The issue comes from configuration of Xampp , you should put your baseUrl in config of Xampp not in .env Just close this :smile

Thanks again ❤️