Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - Version 4.3

[eluser]wiredesignz[/eluser]
Core extension libraries such as MY_Validation should still be located in your application/libraries directory.

Any library loaded into a module is not directly available to the $CI super object, however it is accessible via the module.

[eluser]Avatar[/eluser]
I've created a lib that goes with this one if anyone one wants to check it out

http://codeigniter.com/wiki/Smarty_HMVC_...ables_Lib/

[eluser]GSV Sleeper Service[/eluser]
well, I'm confused, the wiki doesn't explain much, can anyone point me to some example code using modular_extensions?

[eluser]wiredesignz[/eluser]
Page 17 of this thread has an example
http://ellislab.com/forums/viewreply/366295/

[eluser]GSV Sleeper Service[/eluser]
many thanks wiredesignz, I skimmed through this thread earlier and missed page 17

[eluser]gerben[/eluser]
I get an error when I try to load a language file:

"language/english/application.php does not contain a valid lang array"

The strange thing is that I don't get this error with the dutch translation, which is basically the same file, only different words (doh!)

Any idea what could cause this error, because I don't see any errors in the file itself.

[eluser]wiredesignz[/eluser]
If one module language loads correctly then another should also, that is strange.

Are there any file name conflicts or other files with the same name in the modules search path that it may be finding first?

You could try this in modules_helper.php
Code:
//line 72
modules::debug_in($lang);

[eluser]gerben[/eluser]
If I add that line I get a notice:

Message: Undefined variable: lang

Filename: helpers/modules_helper.php

Line Number: 72


Which probably isn't strange, but the strange thing is that I don't get this notice when I switch the language back to dutch.

Quote:Are there any file name conflicts or other files with the same name in the modules search path that it may be finding first?

The only file that has the same name is the dutch translation Smile The file is called application_lang.php, but I don't suppose that causes a conflict with my "application" folder.

[eluser]wiredesignz[/eluser]
The problem may be that the file loader has previously loaded a file named application_lang.php, as it uses include_once to prevent class conflicts.

Maybe try a different filename or I may need to re-write the file loader to cope with this situation.

Try this, replace the file loader function in modules_helper.php
Code:
//line 62
    function load_file($file, $path, $type = 'class', $result = TRUE)
    {
        $file = str_replace(EXT, '', $file);

        if ($type == 'class')
        {
            include_once $path.$file.EXT;
        }
        else
        {
            include $path.$file.EXT;
            
            if (!isset($$type) OR !is_array($$type))
            {        
                show_error($path.$file.EXT." does not contain a valid {$type} array");
            }
            
            $result = $$type;
        }
        
        log_message('debug', "File loaded: ".$path.$file.EXT);
        return $result;
    }
If this is acceptable I will add the change to version 4.0.22

[eluser]gerben[/eluser]
[EDIT]

I'll try it right now!




Theme © iAndrew 2016 - Forum software by © MyBB