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

[eluser]Gerard N[/eluser]
Hey Zach and community,

To Zach: Regarding the change log... The one you directed me to has all the logs up to the version I have :-) (0.9.2)

Can you recall some of the bigger new things/fixes (other than the license change) in the latest two versions of matchbox?

What is the "the PHP4 problem" you mentioned? I tried to scan through the thread but nothing caught my eye. I am a bit weary though (too many hours coding).

To Everyone:
Can you guys help me out? Not sure if this is the right place for this question.

I'm not sure if I just don't get the custom routing of CI or if Matchbox is affecting custom routes.

I am trying to do this custom route:

Code:
$route['issue/(\d+)/page/(\d+)'] = 'my_module/my_controller/view_issue/$0/$1';

The routing to the controller works great, it just isn't getting the parameters correct. view_issue keeps thinking 'page' is the second parameter.

I found that the following works...
Code:
$route['issue/(\d+)/(\d+)'] = 'my_module/my_controller/view_issue/$0/$1';

...but was really hoping to get the first version working.

Any help on this would be appreciated.

Cheers,
Gerard

[eluser]zdknudsen[/eluser]
The PHP4 problem, is that you can't extend the Loader class in PHP4 (and the crew refuses to fix this Tongue , see bug report). So in the later versions I overwrote it instead, thus leaving no need for a PHP4 fix file.

Most of the chances after 0.9.2 has been bugfixes as far as i recall. However, I know I added some (debug) logging and the possibility of changing the default view folder (loader->_ci_view_path), to make Matchbox compitable with certain View libaries, in the latest versions. Might be more, can't really remember. If you're running without problems you might not need to update, however, I doubt you'll have any issues doing so.

Don't know about the routing though...

[eluser]Adods[/eluser]
will matchbox redirect to default controller when the controller called doesn't exist?? or call default method when the method called doesn't exist??

[eluser]zdknudsen[/eluser]
No, it will not. Matchbox strives to work exactly like CodeIgniter on all other points except organization. This has the added benefit that frequent questions (like yours above) that have been solved with a standard CodeIgniter installation should be usable even with Matchbox running. Have a read on routes and controller remapping in the user guide or search the forums Smile

[eluser]Ethan Dunham[/eluser]
Zacharias-

First, thanks for the license update! Second, I found one minor issue with the config loader. With my modules, I developed a kind of faux-plug-in system with them. To simplify things, Each module gets its own config file within its module folder. Now, if I name the config files differently everything is fine. But when I name them all the same, like "config.php" then only the first one will load.

I modified your MY_Config.php file to attach the module name to the filename in the $this->is_loaded array, which seems to solve the issue. Here's how I modified the load function:

Code:
function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
    {
        // {{{ Matchbox
        $ci  = &get;_instance();
        $module = $ci->matchbox->argument(3);
        
        $file = ($file == '') ? 'config' : str_replace(EXT, '', $file);
        if (in_array($module.$file, $this->is_loaded, TRUE))      // <---- Note the $module.$file here
        {
            return TRUE;
        }

        if (!$filepath = $ci->matchbox->find('config/' . $file . EXT, $module)) {
            if ($fail_gracefully === true) {
                return false;
            }

            show_error('The configuration file ' . $file . EXT . ' does not exist.');
        }

        include($filepath);

        // }}}

        if ( ! isset($config) OR ! is_array($config))
        {
            if ($fail_gracefully === TRUE)
            {
                return FALSE;
            }
            show_error('Your '.$file.EXT.' file does not appear to contain a valid configuration array.');
        }

        if ($use_sections === TRUE)
        {
            if (isset($this->config[$file]))
            {
                $this->config[$file] = array_merge($this->config[$file], $config);
            }
            else
            {
                $this->config[$file] = $config;
            }
        }
        else
        {
            $this->config = array_merge($this->config, $config);
        }

        $this->is_loaded[] = $module.$file;      // <---- Note the $module.$file here
        unset($config);

        log_message('debug', 'Config file loaded: config/'.$file.EXT);
        return TRUE;
    }

Is this something you could address in an upcoming release? Thanks!

Ethan

[eluser]zdknudsen[/eluser]
Ah, good catch. This might very well be a reoccuring issue within my code, as I'm pretty similar checks are made for several resources. Will definately be fixes as soon as possible.

[eluser]Unknown[/eluser]
Hi Guys,

First thanks for this great module system I really like it. Makes application development so much easier to organise.

However, I'm having a problem with sub folders in modules.
If I place a controller called Test in the main module folder it works fine ie:
site.com/front/test

However when I move test to a sub folder it just shows a 404 error:
site.com/front/general/test

Any ideas why this isn't working??

Thanks Smile

[eluser]flokky[/eluser]
@Zacharias: Have you got any idea when your Module Manager is completed? It would be great to learn from that code.

[eluser]murphy2006[/eluser]
Hello,

First of all, thanks for a greate tool!

I am just wondering if there is a way to use "local" routing for each module.
Like it is now I have to name the controller and functions so that the URL gets "clean".

For example:

Module Name: Groups
Controller Name: Action
Function Name: archive

Like this: groups/action/archive/

I would like to shorten the URL.

Like this: groups/archive/

I think I can do this in the main router file but is it possible to use one
MY_Routing file for each module instead, makes it easier to package.

Thankful for all help!

[eluser]zdknudsen[/eluser]
Sorry for the late response. Smile You could also name your controller the same as the module. That way, you can omit the module name.

Module Name: Groups
Controller Name: Groups
Function Name: archive

groups/archive/




Theme © iAndrew 2016 - Forum software by © MyBB