Created
          June 22, 2014 08:55 
        
      - 
      
- 
        Save GDmac/dae6bcce24b1c42d7fa1 to your computer and use it in GitHub Desktop. 
    Debug Override plugin, disable ExpressionEngine template debugging from a template
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| $plugin_info = array( | |
| 'pi_name' => 'debug_override', | |
| 'pi_version' =>'1.0', | |
| 'pi_author' =>'GDmac', | |
| 'pi_author_url' => '', | |
| 'pi_description' => '', | |
| 'pi_usage' => '{exp:debug_override override="all|ajax"} default is override on ajax calls', | |
| ); | |
| class debug_override { | |
| public function __construct() | |
| { | |
| $this->EE =& get_instance(); | |
| $override = $this->EE->TMPL->fetch_param('override', 'ajax'); | |
| // no debugging or output-profiler for ajax | |
| if( ($override=='all') || ($override=='ajax' && AJAX_REQUEST)) | |
| { | |
| $this->EE->TMPL->debugging = FALSE; | |
| $this->EE->output->enable_profiler(FALSE); | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment