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

[eluser]gerben[/eluser]
Quote:EDIT: One thing you should note about having modules in the base url (root) or any other place than in the APPPATH. Controllers won’t work. So if you want to use modules with controllers (which I assume you do) you have to have them in your application folder. However, modules just containing helpers, libraries, etc. can go in BASEPATH.

Ok, that's very useful information Smile Thanks! If this is the case I'm even more in favor of a module-installer. Though I think it might be hard to make one that fits in with everyone's application: user-management, menu-system, etc. I think you should start simple: just an interface to upload or delete modules. Maybe activate/de-activate too, and users can adjust it to their own application/needs.
#12

[eluser]zdknudsen[/eluser]
gerben, I found out that I might actually be able to make modules in places other than APPPATH that can also load controllers, I'll find out. I'm thinking of adding an config file where you have an array of places to look for modules (since some people won't need the BASEPATH and some might to store them in the root).

Regarding the manager. xwero: setting up and removing related database tables was the first reason i started thinking about a module manager. However I'm unsure of how feature heavy it should be. I mean I could stuff it but developer might be annoyed with the extra work required to make a matchbox module.

I was considering making a module interface that uses a matchbox library for most of it's functionality so developers could load that library and use it for their own module manager (with their own authentication and layout) and just disable the standard one.
#13

[eluser]xwero[/eluser]
Maybe there should be a database config file so that developers can adjust the tables/fields for each site they add the module to. You never know if you can start from scratch or that you have to use existing tables. The problem is how to give maximum flexibility and keep it programmable.
#14

[eluser]gerben[/eluser]
Quote:gerben, I found out that I might actually be able to make modules in places other than APPPATH that can also load controllers, I’ll find out. I’m thinking of adding an config file where you have an array of places to look for modules (since some people won’t need the BASEPATH and some might to store them in the root).

Cool! I thought it had to be possible, because I already run all sorts of CI stuff from outside of the application/system folders.

A config file would be marvelous, and make the module manager very flexible. A nice side-effect would also be that you can have different kinds of modules in different places. Yesterday I managed to load a module as a widget (so it can be dragged around anywhere in the layout), and with a config-file I could have seperate folders for normal modules and widget-modules.

As for a table-installer: you can first keep it simple by letting module-designers just create an install.php which contains all queries, and then call it from the admin-panel.
#15

[eluser]zdknudsen[/eluser]
xwero: I think that enabling table/field custamization is up to the programmers of the modules to get right. I mean if the table names are hardcoded they will be hard to custamize. However, I will encourage not doing so on my "Standards" wiki page if/when I get the manager done.

gerben: Guess what? I got it working Smile I've made a config file containing an array of directories relative to your application folder in which codeigniter should look for modules. It'll be included in the next release (it'll require some more tweaking and testing). About the table-installer in the module manager, what I am doing is giving developers the opportunity to include and modulename_module.php file with methods like install(), remove(), etc. So developers could easily put table creation in there as well as some pre installation configuration forms.

I also updated a few files so they'll be compatible with CI 1.5.5.
#16

[eluser]nassdzr[/eluser]
Zacharias, i know this one is a fabulous library you're developing.

if somehow from one module controller, can i use other method from another module controller class? Do i will break MVC concept with this? Or your library means only to load another module's model/view/library/config/etc.. except controller?

thankyou Smile
#17

[eluser]zdknudsen[/eluser]
Using controller methods from other controllers than the currently loaded one is a limitation of CodeIgniter itself and I belive it has been discussed before. Have a look at this thread:

http://ellislab.com/forums/viewthread/55212/
#18

[eluser]zdknudsen[/eluser]
Matchbox 0.9.1 has been released. It now includes a configuration file for configuring in which directories to look for modules. Documentation has been updated accordingly.

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

[eluser]pestilence[/eluser]
Hello there,
I think I have a problem with matchbox, parameters are not parsed properly for my application.
To be more specific I have the following directory structure on my test box:
Code:
codeigniter\system\application\modules\newsletter\
Which has the following folders (the newsletter directory):
Code:
controllers
libraries
views

Inside controllers I have 2 files
Code:
form.php
subscribe.php

Everything works fine except parameters!
For instance In my form.php I have the following class functions:
Code:
class Form extends Controller {
    
    function index()
    {
        $this->load->view('form');
    }
    
    function lang($lang = null)
    {
        if( $lang !== null )
        {
            echo "Language: $lang\n";
        } else {
            echo "No Language!\n";
        }
    }
}

When calling in my browser:
http://localhost/codeigniter/newsletter/form

My form is properly displayed.
If I call it:
http://localhost/codeigniter/newsletter/form/lang I get:
Code:
Language: lang
This remains the same even if I:
http://localhost/codeigniter/newsletter/form/lang/greek
I get:
Code:
Language: lang
#20

[eluser]pestilence[/eluser]
Ok I think I found the problem:
file: Router.php (CI core)
Code:
function _reindex_segments()
    {
        // Is the routed segment array different then the main segment array?
        $diff = (count(array_diff($this->rsegments, $this->segments)) == 0) ? FALSE : TRUE;
    
        $i = 1;
        foreach ($this->segments as $val)
        {
            $this->segments[$i++] = $val;
        }
        
        unset($this->segments[0]);
        
        if ($diff == FALSE)
        {
            $this->rsegments = $this->segments;
        }
        else
        {
            $i = 1;
            foreach ($this->rsegments as $val)
            {
                $this->rsegments[$i++] = $val;
            }
            unset($this->rsegments[0]);
        }
    }

Commenting out the line where the rsegments array is assigned the segments array seems to resolve the issue:
Code:
if ($diff == FALSE)
{
  //$this->rsegments = $this->segments;
}




Theme © iAndrew 2016 - Forum software by © MyBB