[eluser]kaejiavo[/eluser]
[quote author="stormbytes" date="1288148527"]Marco,
I just tried loading the config file using $CI->load->config() prior to accessing the index, and it worked! I'm glad you posted the tip as this half-solves my problem, though my original question still stands. Why can't the helper access pre-loaded variables? ($this->load->vars($var_name)). They are certainly accessible from the View, and the helper function is being called from the View. Weird..
A follow up question -
Do you know if it's possible to pick up the value of default controller from Routes.php programmatically somehow?
Cheers![/quote]
Daniel,
if you read the user_guide chapter Helpers, you will learn that helpers
Quote:Unlike most other systems in CodeIgniter, Helpers are not written in an Object Oriented format. They are simple, procedural functions. Each helper function performs one specific task, with no dependence on other functions.
As a function doesn't know of your object context, this should be the answer to your question.
If you need a ver in a function you have to submit it as a parameter, as you certainly know.
myfunction($param1, $param2, $param3)
So when you have received the vars from your config file in your controller or view, simply change your helper function so that it accepts them as params and there you go.
Marco