Yeah, I’ve got to document it better, it’s a pretty usefull configuration item.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
November 25, 2007 2:24pm
Subscribe [65]#241 / Feb 19, 2008 10:32am
Yeah, I’ve got to document it better, it’s a pretty usefull configuration item.
#242 / Feb 20, 2008 4:52pm
i finally got around to a project for which i needed matchbox so first up great code 😊 easy to read and clear seperation showing where your code and CI’s code stop and start, saved me alot of time.
one thing i noticed was that the autoload pulls data soley from the main application/config/autoload.php file have you considered also pulling in module/config/autoload.php to let people autoload resources which all modules need and then autoload the resources which the current module needs but the other modules dont need
#243 / Feb 20, 2008 4:55pm
Indeed I have. Still haven’t found a satisfying way to do so, though.
#244 / Feb 22, 2008 8:05am
How do you even use Matchbox?
I did the following;
* matchbox.php is in application/config
* loader.php, matchbox.php, my_config.php, my_language.php, router.php are in application/libraries
When I go to index.php/{controllertitle}/
I get a print_r of arrays?
In your googlecode page it says;
“www.example.com/module/controller/method/parameter”
So, do I need to do;
“localhost/module/{controllertitle}”
Why does module appear in the URL?
Please clarify your documentation and how to use Matchbox. Even a case study example would help.
#245 / Feb 22, 2008 10:02am
The print_r of arrays leads me to think that you haven’t downloaded the latest version. Please avoid downloading releases that are marked as deprecated. The latest version can be found here:
http://matchbox.googlecode.com/files/Matchbox-0.9.3-Beta-r200.zip
I feel my documentation is very throughout and if you read the introduction wikipage it is explained what the module segment in the URL does (also how it can be omitted). I am currently developing a module manager (which will be a module itself), i guess that will work pretty well as an example.
Basicly Matchbox works like CodeIgniter, only difference is how you can organize your files.
#246 / Feb 22, 2008 11:26am
So what do you need first modules or the module manger, its the whole chicken and the egg. How can you install the module manager if you don’t have the module manager. hehhe
So what new features will this bring, installing and un-installing modules? Because atm I only use modules for base underlying libraries and controllers so I can keep my code separate from CI + any code a client wants on top of my base system.
#247 / Feb 22, 2008 11:55am
Well, most modules don’t need to be installed (other than dragged and dropped), so I guess the modules comes first 😉
Anyway, yeah it’s pretty much just installing/un-installing, but I’m still considering initialization/updating/etc. Progress is very slow though, haven’t got as much time as I’d like to.
#248 / Feb 23, 2008 2:31am
WOW…. It’s nice
But, can Matchbox set default controller for each modules??
Eg. I have module called ‘test’ which have controller named ‘foo’. I want to set ‘foo’ as default controller for ‘test’ module. So, when I call http://localhost/ci/test/ it’s automatically call ‘foo’ controller on ‘test’ module. How can i do that??
Thanks
#249 / Feb 23, 2008 5:28am
I got the matchbox to work now.
Am I right in thinking that the URL paths are the same as if you didn’t install matchbox?
ie:
index.php/{controllername}
Also, do I need to update all the links in my views to point to modules/{module_name}/{controller}?
Finally when handling GET/POST forms, where should the action be going to?
#250 / Feb 23, 2008 6:37am
Adods and gh0st: matchbox urls and default controllers are both explained in the introduction page on http://matchbox.googlecode.com
The controllers themselves work like they always have. However, the way you store and access them are slightly different. At its simplest this is how it works.
http://www.example.com/module/controller/method/parameter
1. The first segment represents the module in which the controller can be found.
2. The second segment represents the controller that should be invoked.
3. The third segment represents the method that should be called.
4. The fourth, and any additional segments, represents the variables that will be passed to the controller.As you may have noticed the only difference from the standard style is the module segment in front. There are two exceptions, though.
1. If the controller is located in a subfolder then the subfolder must be added as another segment between the module and controller segments.
2. If the controller have the same name as the module, the controller segment can be omitted.
3. If the controller is in a subfolder and have the same name as the subfolder, the controller segment can be omitted.
Please note the second and third exceptions which explain how to omit the module segment (e.g. a default controller).
Where to send GET/POST is up to you and has nothing to do with Matchbox 😊
#251 / Feb 23, 2008 10:56am
I was just wondering there’s no way to implement matchbox is there without overwriting core CI files? Was only thinking since it means updating the CI core is harder.
#252 / Feb 23, 2008 11:11am
I cannot stress this enough: Please read the documentaton!
Quote from the installation wikipage:
===Installation Instructions===
By following these few steps you are good to go.1. Unzip the package.
2. Upload the file in the /config directory to your /application/config directory.
3. Upload the files in the /library directory to your /application/libraries directory.That’s it!
#253 / Feb 23, 2008 11:16am
I take it you posted that for me? I know how to install it I have been using it for ages now (a month or more) and love it. What I am saying is you extend the core loading files, I know it doesn’t ‘actually’ overwrite them but it means if they update the core loader file, yours will replace any changes made.
What I was meaning (which maybe I didn’t make clear) was to achieve the modular design you have to extend the CI core files to get it done. There’s no other way to get it to work?
#254 / Feb 23, 2008 12:51pm
Ah, sorry, my bad. 😊 Anyway, in order to achieve this kind of modularity while still being able to use the standard load->resource calls I have to overwrite the Loader class. Well, at least I think so.
#255 / Feb 23, 2008 9:53pm
Matchbox 0.9.4
So I finally got time to change the license (from GPL to LGPL). Also made it possible to extend libraries from modules (not only base libraries), not quite sure if this works as suspected, adamp1 you’re the one who requested this, could you try and see if it does what you want? 😊
http://matchbox.googlecode.com/files/Matchbox-0.9.4.zip