• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] - Show or Hide Debug Bar

#1
Dear,

How to show / hide Debug Bar in app
(Default: Debug Bar show when I set CI_ENVIRONMENT = development)

Now I want show or hide in coding (not in .evn)

Thanks for help

Learning CI4 from my works, from errors and how to fix bugs in the community

Love CI & Thanks CI Teams

Reply

#2
i mostly ignore the .env i just use he line :

Code:
$_SERVER['CI_ENVIRONMENT'] = 'development';

in index.php located in public directory

i mostly ignore the .env i just use he line :

Code:
$_SERVER['CI_ENVIRONMENT'] = 'development';

in index.php located in public directory

when you change 'development' to 'production' bottom bar disappears
Reply

#3
Dear captain-sensible,
Can i set it in case:

Code:
if ($role == 'admin')
{
    $_SERVER['CI_ENVIRONMENT'] = 'development';
}

Learning CI4 from my works, from errors and how to fix bugs in the community

Love CI & Thanks CI Teams

Reply

#4
Yes you can.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#5
(09-29-2020, 01:57 AM)InsiteFX Wrote: Yes you can.

Thanks thanks hehe

Dear,

Set
Code:
$_SERVER['CI_ENVIRONMENT'] = 'development';

It not working

Learning CI4 from my works, from errors and how to fix bugs in the community

Love CI & Thanks CI Teams

Reply

#6
make sure that either you don't use .env or that values don't clash between direct editing in php and the .env

thats why i ignore .env because i probably won't remember I have values set in .env and others direct in php code

I changed in index.php located public dir

Code:
$_SERVER['CI_ENVIRONMENT'] = 'development';

to

Code:
$_SERVER['CI_ENVIRONMENT'] = 'production';

and back & it definitely works .
Reply

#7
(09-29-2020, 04:39 AM)captain-sensible Wrote: make sure that either you don't use .env or that values don't clash between direct editing in php and the .env

thats why i ignore .env because i probably won't remember I have values set in .env and others direct in php code

I changed in index.php located public dir

Code:
$_SERVER['CI_ENVIRONMENT'] = 'development';

to

Code:
$_SERVER['CI_ENVIRONMENT'] = 'production';

and back & it definitely works .

Thanks for help
Now it working fine
Kaka

Learning CI4 from my works, from errors and how to fix bugs in the community

Love CI & Thanks CI Teams

Reply

#8
There is also the possibility of removing it (whilst still in the development environment, and on-the-fly in one's active code, if that floats your boat) using settings in \Config\Filters.php:

Code:
public $globals = [
    'before' => [
      ...
    ],
    'after'  => [
      ...
    'toolbar', // <= comment this or remove it from $globals to disable the debug toolbar
    ]
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.