Welcome Guest, Not a member yet? Register   Sign In
Autoloading helpers stored outside of application folder not working
#1

[eluser]tinawina[/eluser]
Hi there -

My CI setup looks like this:

Code:
System folder:
/home/private-area/codeigniter/system

Application folder:
/home/public-html/www/application

I am storing all of my helper and library files in the System Folder like this:

Code:
Libraries
/home/private-area/codeigniter/system/libraries/custom/-my files-

Helpers
/home/private-area/codeigniter/system/helpers/custom/-my files-

When I load a helper into one of my controllers, I use this and it works fine:

Code:
$this->load->helper( 'custom/title_helper' );

I just tried to autoload my helpers, located in the "custom" sub-folder, by adding this info to my config/autoload.php file and nothing (except 'url') works:

Code:
$autoload['helper'] = array(
'url',
'custom/character_helper',
'custom/menu_helper',
'custom/title_helper'
);

I get an error message like this:
Quote:Unable to load the requested file: helpers/character_helper.php

I tried dropping "custom/" from the autoload array but that doesn't fix things.

I don't want to muck around in the core Loader class and re-route all calls to helpers to this custom folder because, when all is said and done, we will have a lot of subdomains also pulling from this codeigniter installation but also using their own individual helpers and libraries.

How can I get this working correctly? Appreciate any help, advice, insight!
#2

[eluser]taber[/eluser]
I'm trying to do the same exact thing, I was hoping there was a solution here, damn. Sad
#3

[eluser]Aken[/eluser]
This works just fine on a fresh install of 2.1.2.
#4

[eluser]taber[/eluser]
Turns out in my case it was just a permissions issue. The error message when CI couldn't load the library was a bit vague but I figured it out! Smile




Theme © iAndrew 2016 - Forum software by © MyBB