Answers.Body: <p>In this situation you don't want to use a config file and instead you want to use plugin settings. The settings have a UI and save to the db, which does exactly what you want. The config files are meant to only be updated manually updating them.</p>
  
  <p><a href="http://buildwithcraft.com/docs/plugins/plugin-settings" rel="nofollow">http://buildwithcraft.com/docs/plugins/plugin-settings</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-25T03:28:37.113Z
Answers.LastActivityDate: 2015-02-25T03:28:37.113Z
Answers.UserDisplayName: Justin Kimbrell
Body: <p>Is it possible to update the config.php file in a plugin outside of manually opening and adjusting the array? I'm hoping there's a way I can have a certain user group be able to change the array values with the plugin's control panel page.</p>
  
  <p>The config file is very simple, it looks like this:</p>
  
  <pre><code>&lt;?php 
  
  return [
  
      'active_features' =&gt; [
           'change_team' =&gt; false,
           'change_series' =&gt; false,
           'change_user_settings' =&gt; false,
      ],
  
  ];
  </code></pre>
  
  <p>And I need a way for them to be able to toggle, say, 'change_team' to true or false every so often. I've searched around and haven't found anything at all to try. Does this kind of functionality exist at all?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-24T22:41:07.770Z
Comments.Text: Wouldn't you just want to use the Plugin settings for this? The settings have a UI and save to the db, which does exactly what you want. The config files are meant to only be updated manually updating them. I could be wrong, but if it were me I would just create a settings page for this.
Comments.UserDisplayName: Justin Kimbrell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-24T22:47:12.757Z
Comments.Text: I'll look into plugin settings, I didn't even know about those. So much to learn with Craft!
Comments.UserDisplayName: taylor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-24T22:59:30.817Z
Comments.Text: @JustinKimbrell Wanna add that as an answer, Justin?
Comments.UserDisplayName: Brad Bell
Tags: <plugin-development><control-panel><php><configuration>
Title: Update Plugin's config.php
ThreadText: # Update Plugin's config.php
  
  (Asked by: username_0 on 2015-02-24)
  
  Is it possible to update the config.php file in a plugin outside of manually opening and adjusting the array? I'm hoping there's a way I can have a certain user group be able to change the array values with the plugin's control panel page.
  
  The config file is very simple, it looks like this:
  
  ```
  <?php 
  
  return [
  
      'active_features' => [
           'change_team' => false,
           'change_series' => false,
           'change_user_settings' => false,
      ],
  
  ];
  
  ```
  
  And I need a way for them to be able to toggle, say, 'change\_team' to true or false every so often. I've searched around and haven't found anything at all to try. Does this kind of functionality exist at all?
  
  **Tags:** plugin-development, control-panel, php, configuration
  
  > **Comments:**
  > **username_1**: Wouldn't you just want to use the Plugin settings for this? The settings have a UI and save to the db, which does exactly what you want. The config files are meant to only be updated manually updating them. I could be wrong, but if it were me I would just create a settings page for this.  
  > **username_0**: I'll look into plugin settings, I didn't even know about those. So much to learn with Craft!  
  > **username_2**: @username_1 Wanna add that as an answer, username_1?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-02-25. Score: 2 | Accepted answer
  
  In this situation you don't want to use a config file and instead you want to use plugin settings. The settings have a UI and save to the db, which does exactly what you want. The config files are meant to only be updated manually updating them.
  
  <http://buildwithcraft.com/docs/plugins/plugin-settings>
  
  
  ---
  
  