title: Undefined variable on Codeigniter when try to pass data from controller
body: <p>I'm new at Codeigniter. I try to pass some data into a view. I have a route like this:</p>
  
  <pre><code>$route['accounts/(:any)'] = 'accounts/$1';
  </code></pre>
  
  <p>and in my Account class i have register function like this: </p>
  
  <pre><code>public function register()
      {
          $csrf  = array(
              'name' =&gt; $this-&gt;security-&gt;get_csrf_token_name(),
              'hash' =&gt; $this-&gt;security-&gt;get_csrf_hash()
          );
          $this-&gt;load-&gt;view('partials/head');
          $this-&gt;load-&gt;view('partials/nav');
          $this-&gt;load-&gt;view('auth/register',$csrf);
          $this-&gt;load-&gt;view('partials/footer');
      }
  </code></pre>
  
  <p>then in my register.php i try to print that $crsf like this:</p>
  
  <pre><code>&lt;input type="hidden" name="&lt;?=$csrf['name'];?&gt;" value="&lt;?=$csrf['hash'];?&gt;" /&gt;
  </code></pre>
  
  <p>when i access my page which in compro.xyz/accounts/register it give me this error:</p>
  
  <pre><code>A PHP Error was encountered
  Severity: Notice
  
  Message: Undefined variable: csrf
  
  Filename: auth/register.php
  
  Line Number: 13
  
  Backtrace:
  
  File: D:\xampp\htdocs\compro\application\views\auth\register.php
  Line: 13
  Function: _error_handler
  
  File: D:\xampp\htdocs\compro\application\controllers\Accounts.php
  Line: 19
  Function: view
  
  File: D:\xampp\htdocs\compro\index.php
  Line: 315
  Function: require_once
  
  " value="
  A PHP Error was encountered
  Severity: Notice
  
  Message: Undefined variable: csrf
  
  Filename: auth/register.php
  
  Line Number: 13
  
  Backtrace:
  
  File: D:\xampp\htdocs\compro\application\views\auth\register.php
  Line: 13
  Function: _error_handler
  
  File: D:\xampp\htdocs\compro\application\controllers\Accounts.php
  Line: 19
  Function: view
  
  File: D:\xampp\htdocs\compro\index.php
  Line: 315
  Function: require_once
  
  " /&gt;
  </code></pre>
  
  <p>seem's like my register doesn't recognize <code>$csrf</code>. I really have no idea what can cause it, I usually using Twig and since it Codeiginter I don't know much about it. And currently I'm using latest version.</p>