Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you have a complete example available? #47

Open
Josh5A opened this issue Jun 9, 2024 · 0 comments
Open

Do you have a complete example available? #47

Josh5A opened this issue Jun 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Josh5A
Copy link

Josh5A commented Jun 9, 2024

I can't get any of the examples as written to work. They all seem to be missing instructions. For example, simple initializing has a javascript section but what file does that code go into?

When I try this:

<?php

namespace App\Controllers;

use \Hermawan\DataTables\DataTable;

class Test extends BaseController
{
    public function index()
    {
        $db = $this->db;
        $builder = $db->table('mytable')->select('id, title');
        
        return DataTable::of($builder)->toJson();
        
    }
}

I get the following error:

{
    "error": "no datatable request detected"
}
@Josh5A Josh5A added the bug Something isn't working label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant