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

[eluser]wiredesignz[/eluser]
Could you please fix up that code you posted, put it in code tags thanks.

EDIT:
Plus its so big, people won't read it properly anyway, but it is ugly like that. Wink
#72

[eluser]badgeek[/eluser]
maybe this is out of topic but what is the difference between

Code:
$this->validation->setup =& modules::run('validation_module', '', 'register_validation');

and

Code:
$this->validation->setup = modules::run('validation_module', '', 'register_validation');


is the first method for php4?
#73

[eluser]wiredesignz[/eluser]
Yes mostly for PHP4. This is how I understand it to work:

By saying $this->validation->setup you are creating an object variable in the $this->validation object and then you are wanting to assign a new object into it.

When an object is created it is basically in open memory not connected to anything so using = in PHP4 will make a copy of the object and put it in ->setup, however using =& you are merely putting a reference to the new object into ->setup, not a copy of it.

EDIT:
PHP5 does everything by reference by default so it doesn't matter so much.

I always use the =& as a habit.

Hope this helps. (Someone with more skills may offer their input)
#74

[eluser]Avatar[/eluser]
wiredesignz is 100% correct about that
#75

[eluser]badgeek[/eluser]
i'm understand now, thanks!
#76

[eluser]wiredesignz[/eluser]
Version 4.0.9 is available on the wiki.
Added module language loader
#77

[eluser]gerben[/eluser]
In which version will the MY_loader be included? Being able to directly call modules from the url would make it even more versatile!
#78

[eluser]wiredesignz[/eluser]
I really want to do as much bug fixing to the Extensions as I can before I introduce something new. Thanks gerben Wink
#79

[eluser]Avatar[/eluser]
yes gerben that would be nice, but how would you be able to call a sibling module with it not thinking it as a function of a module. Or would there be a _remap function that dynamically forwards it to the siblings? Which would mean that for sibling modules I would have to add a case in the _remap function. Just trying to figure out how this would work with siblings and siblings siblings. Thank you.
#80

[eluser]Avatar[/eluser]
can we add this to_string() to the mainstream build? it makes accessing sibling modules easier with a string like this,
Code:
modules::to_string('main_module/sibling_module/another_sibling_module');
//returns main_module/modules/sibling_module/modules/another_sibling_module/another_sibling_module
when this string is fed into modules::run it passes it to path_to somehow and adds controller/ between another_sibling_module and another sibling module, making it:

main_module/modules/sibling_module/modules/another_sibling_module/controllers/another_sibling_module

It's more of a convenience to access modules with:

module/module/module

instead of:

main_module/modules/sibling_module/modules/another_sibling_module/another_sibling_module

Code:
function to_string($module, $mod_str = '')
    {      
        $_mods = explode('/',$module);
            
        $pos = strrpos($module, '/');
        $fm  = substr($module, $pos + 1);
      
        foreach($_mods as $mod => $m)
        {
            $mod_str .= ($fm != $m) ? $m.'/modules/' : $fm.'/'.$fm;
        }
            
        return $mod_str;
    }
thank you




Theme © iAndrew 2016 - Forum software by © MyBB