Welcome Guest, Not a member yet? Register   Sign In
CI4 and debug string on response
#1

I have a problem with json strings, when the page returns me a josn value is followed by a debug string.

I commented in the "Toolbar.php" config file
PHP Code:
use CodeIgniter\Debug\Toolbar\Collectors\Views

but it keeps getting out the string, how can I fix it?

The page is not a view but directly the controller that after processing the data in the model returns the response json string
Reply
#2

I had the same problem and ended up disabling the toolbar in app\Config\Boot\development.php
I hope this works for you.
Reply
#3

You can also disable it, or modify when it runs, in app/Config/Filters.php.
Reply
#4

Disabled, I was hoping there was a way to not have to disable it Sad , thanks
Reply
#5

(03-11-2022, 03:33 AM)serialkiller Wrote: I have a problem with json strings, when the page returns me a josn value is followed by a debug string.

Can't reproduce it. How to reproduce?

PHP Code:
<?php

namespace App\Controllers;

use 
CodeIgniter\API\ResponseTrait;

class 
Home extends BaseController
{
    use ResponseTrait;

    public function index()
    {
        return $this->respond(['a' => 'b']);
    }

Reply




Theme © iAndrew 2016 - Forum software by © MyBB