0
votes

I created a helper in CodeIgniter 3 which I called asset_helper.php

enter image description here

and this is the controller I use to call this helper:

<?php

class Index extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->load->helper('asset');
    }

    function index()
    {
        $this->load->view('header');
        $this->load->view('nav');
        $this->load->view('title');
        $this->load->view('stat1');
        $this->load->view('footer');
    }

}

but when I access to the controller I get this message:

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

How can I solve this problem?

1
Have you tried auto loading the helper? - bmla
@bmla yes I tried it but I had the same problem - Renaud is Not Bill Gates
Just see if Asset_helper.php file name with upper case. But do not think that would be issue. - Mr. ED
You should also check that web server has permissions to access that file. - Vaviloff

1 Answers

0
votes

Load like this

$this->load->helper('asset_helper');

If you use like this $this->load->helper('asset'); it will never works.B Bcz there is no file call asset