Welcome Guest, Not a member yet? Register   Sign In
Not able to disable debug bar
#1

I'm trying to return a view as json, so looking to other post on this forum I discovered this thread.
So I followed the comment of cyberstunts and tried:

PHP Code:
        if ($this->request->isAJAX()) {
            $output "";

            $this->response->setContentType('Content-Type: application/json');

            foreach ($result[$type 's']['data'] as $item) {
                $output .= view('App\Views\Frontend\Search\item', [
                    'item' => $item
                
]);
            }

            return $this->respond($output);
        

but CodeIgniter didn'd disabled the debug bug even specifying the content type as application/json...
Infact, in the response I get:

PHP Code:
<!-- DEBUG-VIEW START 1 APPPATH/Views/Frontend/Search/item.php --> 

and in the json response this error is raised:

PHP Code:
SyntaxErrorUnexpected token in JSON at position 0 
Reply
#2

PHP Code:
CI_DEBUG false
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB