title: Moodle Redirect, change button to direct to home?
body: <p>This is the button link:
  <code>$dashboardurl = new moodle_url('/local/iomad_dashboard/index.php');</code></p>
  
  <p>I would like to change this to the home page and attempted by changing the var to:</p>
  
  <p><code>$dashboardurl = $CFG-&gt;wwwroot.'/'</code></p>
  
  <p>but no luck. </p>
  
  <p>The var is used here:</p>
  
  <pre><code>    if (isset($data-&gt;submitandback)) {
          $dashboardurl-&gt;param('noticeok', get_string('usercreated', 'block_iomad_company_admin'));
          redirect($dashboardurl);
      } else {
          redirect($linkurl."?createdok=1");
      }
  </code></pre>