CodeIgniter Forums

Full Version: debugbar is breaking my JSON?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to retrieve data for my calendar but for some reason I get this response
Code:
[{"title":"aaa22","start":"2021-04-01","end":"2021-04-01","id":"4"},{"title":"aaaeeee","start":"2021-03-30","end":"2021-03-30","id":"48"},{"title":"beep boop","start":"2021-03-31","end":"2021-03-31","id":"54"},{"title":"lorem ipsum edit","start":"2021-04-06","end":"2021-04-06","id":"55"}]
<script type="text/javascript"  id="debugbar_loader" data-time="1618658976" src="localhost/myapp/?debugbar"></script><script type="text/javascript"  id="debugbar_dynamic_script"></script><style type="text/css"  id="debugbar_dynamic_style"></style>
I have no idea how the <script> is getting there but it's causing a JSON Parse error on my view file.

Controller:

PHP Code:
    function get_activities()
    {
        
$data['start'] = $this->request->getGet('start');
        
$data['end'] = $this->request->getGet('end');
        
$activities $this->Calendar_model->get_activities($data);
        echo 
json_encode($activities);
    } 



Model:
PHP Code:
  function get_activities($data)
  {
    $builder $this->db->table('calendar');
    $builder->where('start >='$data['start']);
    $builder->where('end <='$data['end']);
    return $builder->get()->getResultArray();
  
app/Config/Boot/development.php

CI_DEBUG = false;
(04-17-2021, 12:04 PM)InsiteFX Wrote: [ -> ]app/Config/Boot/development.php

CI_DEBUG = false;
Yup, that fixed it. Thanks!