title: How to solve page blank problem with codeigniter "news" section?
body: <p>I'm following the Codeigniter tutorial: <a href="http://localhost:8080/myproject/user_guide/tutorial/news_section.html" rel="nofollow noreferrer">http://localhost:8080/myproject/user_guide/tutorial/news_section.html</a></p>
  
  <p>When i point my browser to <a href="http://localhost:8080/myproject/news" rel="nofollow noreferrer">http://localhost:8080/myproject/news</a> as the tutorial indicates at the final of the section, "Point your browser to your document root, followed by index.php/news and watch your news page." appears a blank page.</p>
  
  <p>I tried to point to localhost:8080/index.php/news or /myproject/news but occurs the same problem.</p>
  
  <p>Also i tried to set in autoload.php the next:  $autoload['libraries'] = array('database');
  as is indicated in <a href="https://stackoverflow.com/questions/33797565/codeigniter-news-section-tutorial-not-working">codeigniter news section tutorial not working</a> but not solve, so i leave it like this: $autoload['libraries'] = array('');</p>
  
  <p>This is the routes:</p>
  
  <pre><code>   $route['news/(:any)'] = 'news/view/$1';
     $route['news'] = 'news';
     $route['(:any)'] = 'pages/view/$1';
     $route['default_controller'] = 'pages/view';
  </code></pre>
  
  <p>The News.php:</p>
  
  <pre><code>   &lt;?php
     class News extends CI_Controller {
  
      public function __construct()
      {
              parent::__construct();
              $this-&gt;load-&gt;model('news_model');
              $this-&gt;load-&gt;helper('url_helper');
      }
  
      public function index()
      {
              $data['news'] = $this-&gt;news_model-&gt;get_news();
      }
  
      public function view($slug = NULL)
     {
      $data['news_item'] = $this-&gt;news_model-&gt;get_news($slug);
  
      if (empty($data['news_item']))
      {
              show_404();
      }
  
      $data['title'] = $data['news_item']['title'];
  
      $this-&gt;load-&gt;view('templates/header', $data);
      $this-&gt;load-&gt;view('news/view', $data);
      $this-&gt;load-&gt;view('templates/footer');
     }
     }
  </code></pre>
  
  <p>the view.php:</p>
  
  <pre><code>   &lt;?php
     echo '&lt;h2&gt;'.$news_item['title'].'&lt;/h2&gt;';
     echo $news_item['text'];
  </code></pre>
  
  <p>and the News_model.php:</p>
  
  <pre><code>   &lt;?php
     class News_model extends CI_Model {
  
      public function __construct()
      {
              $this-&gt;load-&gt;database();
      }
      public function get_news($slug = FALSE)
      {
      if ($slug === FALSE)
      {
              $query = $this-&gt;db-&gt;get('news');
              return $query-&gt;result_array();
      }
  
          $query = $this-&gt;db-&gt;get_where('news', array('slug' =&gt; 
          $slug));
          return $query-&gt;row_array();
      }
      }
  </code></pre>
  
  <p>I expect to watch the news page</p>