Welcome Guest, Not a member yet? Register   Sign In
Helper doesn't load
#1

[eluser]gh0st[/eluser]
I've built a custom helper and put it in system/application/helpers/MY_destination_helper.php

On my localhost the helper runs fine.

However on the live site, I get this error;

Quote:An Error Was Encountered

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

I call the helper like this;

Code:
// this is in my parent/default controller
$this->load->helper('MY_destination');

I've tried respelling the controller to the same as the error message and I've even tried putting it inside the /system/helpers/ folder.

None of these seem to make any difference.

I've checked the logs created by CI, but there is nothing being created.

Is there something I've overlooked that can explain why this helper is loading on my localhost, but not on live?

Thanks
#2

[eluser]TheFuzzy0ne[/eluser]
[DELETED due to incorrect information being given]
#3

[eluser]JWarren[/eluser]
I'm not sure why this would make a difference, but since you are not extending an existing helper, what if you remove the MY_ prefix?

So you have:

system/application/helpers/destination_helper.php

and

Code:
$this->load->helper('destination');
#4

[eluser]TheFuzzy0ne[/eluser]
I totally agree. It won't make any difference with the way things work, but a "MY_" prefixed file name usually indicates that the file is extending another.

If you wanted to load a file named MY_destination_helper.php, you would load it without the "MY_" prefix, like so:
Code:
$this->load->helper('destination');

This may cause an error to be thrown though, as the loader would expect to load a second file to override.
#5

[eluser]SitesByJoe[/eluser]
Could just be permissions too - check the permissions on the file you uploaded. It may not be set to read or execute.
#6

[eluser]gh0st[/eluser]
For some reason, if I named both in lowercase, to "my__destination_helper.php", it worked fine.

Yes, if I name them both as "destination_helper.php" it also works

This problem is now resolved.

Thanks again!




Theme © iAndrew 2016 - Forum software by © MyBB