• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a way to turn off the debugbar for a specific controller/route

#1
As the title says, im seeking a way to disable the debugbar for specific controllers/routes.

Thank you.
Reply

#2
The debugbar only shows in development mode if you change to production it
will not show.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
Thank you InsiteFX, I know this already, but that doesnt help during development Smile

I've came up with a solution, I've basically placed the following code in the Config/Boot/development.php file just above the CI_DEBUG definition:

PHP Code:
if (!empty($_SERVER['REQUEST_URI']) && substr($_SERVER['REQUEST_URI'], 0) === "/css/")
{
    define('CI_DEBUG'0);



Not sure if it is the best way, but it works.
Reply

#4
Hey crazyR - the Toolbar is attached via controller filter, so you can change the way it's specified to exclude certain uri's there. See the filters docs for more info.
Support Development  • Practical CodeIgniter 3  • Vulcan - CLI Tools for CI4
Reply

#5
Thank you kilishan, That is exactly what I was looking for Smile

I did brush pass that documentation earlier but for some reason I must not have been paying enough attention to realize its importance.

Thanks again.
Reply

#6
@crazyR
> As the title says, im seeking a way to disable the debugbar for specific controllers/routes.

I am not sure of the order that CI_DEBUG is called but I prefer defining the debug boolean constant in index.php.

You could try a conditional grouping of the /Controller/config/routes.php -> $route1 = "route"; and the debug constant will be contained in the same file.
download and make your system directory strict
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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