Welcome Guest, Not a member yet? Register   Sign In
Codeigniter cannot load helpers
#1

I have checked all config files, made sure the helpers are in both system/helpers and application/helpers as well as one or the other. I have tried autoloading helpers, loading the helper in my controller and from the view and no matter what I get an error.

Unable to load the requested file: helpers/_helper.php

It is treating it as if I am trying to load a blank helper such as $this->load->helper(''); but I am using $this->load->helper('url');

This is my controller to load my home page

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Pages extends CI_Controller {

  public function __construct(){
    parent::__construct();
    $this->load->helper('url');
  }

  public function index(){
    $this->load->view('templates/header');
    $this->load->view('home');
    $this->load->view('templates/footer');
  }
}
system/helpers/url_helper.php and application/helpers/url_helper.php both currently exist and have not been edited at all.

If needed I can include my autoload.php but the helper Auto-load Helper Files is currently $autoload['helper'] = array();
Reply
#2

CodeIgniter uses name_helper.php your missing the helper name.

PHP Code:
helpers/_helper.php

// Should be
helpers/name_helper.php 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB