Welcome Guest, Not a member yet? Register   Sign In
Matchbox RC2
#51

[eluser]zdknudsen[/eluser]
Matchbox 0.9.2 has been released. It now features configuration of the determination of what modules are loading what resources. Documentation has been updated accordingly.

Downloads and changelog both found on http://matchbox.googlecode.com/.
#52

[eluser]zdknudsen[/eluser]
Matchbox 0.9.2 release note on previous page.

gerben: What you need to do is remove the View library from your modules, and just have it in your standard library folder and autoload it. You then add 'libraries/View' to the $config['callers'] array in the matchbox config file.

Please let me know if it works (it worked for me).
#53

[eluser]esra[/eluser]
[quote author="Zacharias Knudsen" date="1196567149"]
esra: Is that a working example, meaning that what he is trying to accomplish is doable?[/quote]

It is a working example for MS 2.4.1 with CI 1.5.4. The same approach should work in Matchbox if the View library is loaded.
#54

[eluser]zdknudsen[/eluser]
Ah, I see :-) Where are your View library and views located in that example?
#55

[eluser]gerben[/eluser]
Quote:gerben: What you need to do is remove the View library from your modules, and just have it in your standard library folder and autoload it. You then add ‘libraries/View’ to the $config[’callers’] array in the matchbox config file.

Please let me know if it works (it worked for me).

Hi Zacharias, it didn't work when I did it exactly the way you described, BUT... when I added the view library to Matchbox.php, line 50:

Code:
var $_callers = array('MY_Config', 'MY_Language', 'MY_Loader', 'View');

it worked perfectly fine!

So I think for some reason the matchbox.php config file is not loaded. Which is very strange, because I believe CI loads all files in config.php by default.

When I do (in my module):

Code:
print_r($this->config->item('callers'));

It returns nothing.

Anyway, I believe we're getting there. All I need to find out, is why my config isn't loaded.
#56

[eluser]zdknudsen[/eluser]
Well CI doesn't load all files in the config folder (at least I'm pretty sure it doesn't). My Matchbox library (and most of the other standard libraries that are loaded before CI is fully loaded like the router, etc.) loads the config file a little differently, so it isn't loaded with $this->load->config and it therefor is not available through $this->config->item either.

Anyways what Matchbox does it merge the array you found yourself with the one in the config file, however apparantly it is not working as it should. I can see that you have added the value 'View'. Was that also what you added to the config file?
#57

[eluser]zdknudsen[/eluser]
I just tested it and it appears to merge the two without problems.
#58

[eluser]gerben[/eluser]
Quote:I can see that you have added the value ‘View’. Was that also what you added to the config file?

I've tried both 'library/View', as well as 'View', but both don't work. The strange thing is that when I echo something in the config file, it does show up, so apparently the config file IS loaded, but not merged with the $_callers array. Is there anything I can do to test why this is?
#59

[eluser]zdknudsen[/eluser]
Strange :S Hm. If you put

echo $this->_callers;

in the end of the Matchbox library's matchbox() method it will print what the array contains after the merge. What does it say?
#60

[eluser]gerben[/eluser]
You mean the CI_Matchbox method in Matchbox.php?

It says:

Array ( [0] => MY_Config [1] => MY_Language [2] => MY_Loader )


Sad




Theme © iAndrew 2016 - Forum software by © MyBB