So I have loaded a custom config file in my class __construct().
$this->EE->config->load('custom_config');It’s working well in the control panel area of the site.
But now that I’m working with my templates, the config item seems to have disappeared off of the config object.
when PRE’d within the template
<pre>
$this->EE->config
</pre>
<p>there is no mention of the loaded config file.
why so?
I created my own library class that is autoloaded.
in the library class -
class my_class {
function my_class()
{
$this->EE =& get_instance();
// Load config items
$this->EE->config->load('my_custom_config');
echo '<pre>';
print_r($this->EE->config);
echo '</pre>
<p>’;
}</p>
<pre><code>function test()
{
echo '<pre>';
print_r($this->EE->config);
echo '</pre>';
}
}</pre>
this code will print the “my_custom_config” file items when loaded.
however, if accessed within a template (and template group) i created in EE
via this code
$this->EE->my_class->test();none of the custom config files are loaded. (or maybe overwritten?)
Er, are you not the same Jayson that filed this bug report where we discussed this?
yes i am, but that report is different from this.
the previous one, I mistakenly assumed that EE would be able to autoload custom config files. knowing that I can’t, I now load my config file manually in the __construct() of my custom library - like so.
$this->EE->config->load('my_custom_config');The problem now however, is that even though I loaded it manually, it still disappears later on…
*** re-reading your comment on the last bug report ***
ok, so I probably didn’t understand what you mentioned in the last bug report correctly - are you saying, that in the initialization of a class, a default config file is passed to it, clearing all config items possibly on it? (in this case, my custom loaded config file?)
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.