Example #1
0
 function config()
 {
     if ($_POST) {
         // Use the config lib to convert $_POST into something writable
         $conf = Config::prepareConfigToWrite($_POST);
         // Update config
         Config::writeConfig($conf);
         // Set flash message
         Application::flash('success', 'App config updated!');
         // Force redirect to reload app with new config
         header('Location: ' . $_SERVER['HTTP_REFERER']);
         exit;
     }
     $this->loadView('admin/config', null, 'admin');
 }