title: Fatal error: Assignments can only happen to writable values in C:\xampp\htdocs\dogs\application\controllers
body: <p>I use a local XAMPP server.</p>
  
  <p>PHP version 7.2.13<br>
  CodeIgniter 3.1.10  </p>
  
  <p>When I try to call the page posts, I get this <strong>error message</strong>:</p>
  
  <pre class="lang-none prettyprint-override"><code>Fatal error: Assignments can only happen to writable values in C:\xampp\htdocs\dogs\application\controllers\Posts.php on line 16
  
  A PHP Error was encountered
  Severity: Compile Error
  Message: Assignments can only happen to writable values
  Filename: controllers/Posts.php
  Line Number: 16
  Backtrace:
  </code></pre>
  
  <p>In  Sublime line Number 16 corresponds to: </p>
  
  <pre>$data = ['title'] = 'Latest Posts';</pre>
  
  <p><strong>My controller file Post.php:</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  defined('BASEPATH') OR exit('No direct script access allowed');
  
  class Posts extends My_Controller {
  
  public function index()
  {
      $this-&gt;load-&gt;helper('url');
      $this-&gt;load-&gt;model('Post_model');
  
      $data = ['title'] = 'Latest Posts';
  
      $data = ['posts'] = $this-&gt;Post_model-&gt;get_posts();
  
      $this-&gt;load-&gt;view('templates/header');
      $this-&gt;load-&gt;view('posts/index', $data);
      $this-&gt;load-&gt;view('templates/footer');
      }
  }
  </code></pre>
  
  <p><strong>My view file index.php:</strong></p>
  
  <pre><code> &lt;h2&gt;&lt;?= $title ?&gt;&lt;/h2&gt;
  </code></pre>