Answers.Body: <p>Add this to your plugin/controller:</p>
  
  <pre><code>if (!craft()-&gt;config-&gt;get('devMode'))
  {
      craft()-&gt;templates-&gt;getTwig()-&gt;addExtension(new \Twig_Extension_Debug());
  }
  </code></pre>
  
  <p><em>Thanks to the all-knowing Brandon Kelly, who posted the solution on Slack.</em></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-13T08:43:10.080Z
Answers.Text: I'm trying to integrate this code in my custom plugin. Not sure where to put it - the constructor for Controller class doesn't work (neither does the main plugin class constructor). Can you specify a bit more how to make this work? (I'm using Craft 2.5.2754)
Answers.UserDisplayName: Jure Srpcic
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-20T19:29:47.793Z
Answers.Text: Same, I don't understand exactly where/how to add this code snippet in? I'm wondering if Craft has an update that makes this irrelevant now?
Answers.UserDisplayName: skplunkerin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-06T13:45:12.247Z
Answers.LastActivityDate: 2015-11-06T13:45:12.247Z
Answers.UserDisplayName: Fred Carlsen
Body: <p>Is there a way to make the dump() function available in my plugin templates when devMode is disabled?</p>
  
Tags: <plugin-development><templating><devmode>
Title: Make dump() available when devMode is disabled
ThreadText: # Make dump() available when devMode is disabled
  
  (Asked by: username_0 on 2015-11-06)
  
  Is there a way to make the dump() function available in my plugin templates when devMode is disabled?
  
  **Tags:** plugin-development, templating, devmode
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-11-06. Score: 5 | Accepted answer
  
  Add this to your plugin/controller:
  
  ```
  if (!craft()->config->get('devMode'))
  {
      craft()->templates->getTwig()->addExtension(new \Twig_Extension_Debug());
  }
  
  ```
  
  *Thanks to the all-knowing Brandon Kelly, who posted the solution on Slack.*
  
  > **Comments:**
  > **username_1**: I'm trying to integrate this code in my custom plugin. Not sure where to put it - the constructor for Controller class doesn't work (neither does the main plugin class constructor). Can you specify a bit more how to make this work? (I'm using Craft 2.5.2754)  
  > **username_2**: Same, I don't understand exactly where/how to add this code snippet in? I'm wondering if Craft has an update that makes this irrelevant now?  
  
  ---
  
  