Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] - Show or Hide Debug Bar
#1

(This post was last modified: 09-29-2020, 05:06 AM by nc03061981.)

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

(This post was last modified: 09-29-2020, 01:50 AM by captain-sensible.)

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

(This post was last modified: 09-29-2020, 01:55 AM by nc03061981.)

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

(This post was last modified: 09-29-2020, 02:54 AM by nc03061981.)

(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

(This post was last modified: 09-29-2020, 04:41 AM by captain-sensible.)

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




Theme © iAndrew 2016 - Forum software by © MyBB