I'd like some help please. I'm using Ignited Datatables library in order to display posts. My script at the begining was looking like this
PHP Code:
$this->datatables->select('posts.id, posts.title')->select('DATE_FORMAT(`date_published`, \'%d-%m-%Y\') AS `date_published`', false)
->from('posts')
->unset_column('id')
->add_column('Actions', btn_edit('admin/posts/edit/$1') . ' ' . btn_delete('admin/posts/delete/$1'), 'id'); // this is the part I'm considering
echo $this->datatables->generate();
so basicly in the add_column() I'm generating some button links to edit and delete posts and the urls of these buttons would look like this:
Code:
admin/posts/edit/1
admin/posts/delete/1
So far so good, but when I tryied to JOIN the post categories in the query
PHP Code:
$this->datatables->select('posts.id, posts.title')->select('DATE_FORMAT(`date_published`, \'%d-%m-%Y\') AS `date_published`', false)
->select('posts_categories.title as category')
->from('posts')
->join('posts_categories', 'posts.category_id = posts_categories.id', 'left')
->unset_column('id')
->add_column('Actions', btn_edit('admin/posts/edit/$1') . ' ' . btn_delete('admin/posts/delete/$1'), 'id');
echo $this->datatables->generate();
the urls of the button links broke and I get this, which goes to 404 page:
Code:
admin/posts/edit/id
admin/posts/delete/id
How can I fix this?