Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - HMVC version 5.2

[eluser]Armorfist[/eluser]
Suggestion:

The "$registry" array only stores the class name, so if you have for example 2 controllers with the same name in different modules, and try to load them both, it will only display the content of the first one 2 times:

Code:
//Will load 'modulem/home/index' content two times
//because it thinks the 'home' controller is already loaded
$data['home_data'] .= modules::run('modulem/home/index');
$data['home_data'] .= modules::run('users/home/index');

I think this could easily be solved with "$registry" being a multidimensional array: $registry[MODULE][CLASS]

[eluser]wiredesignz[/eluser]
@johan André, You're welcome, thanks for the feedback.

@Armorfist, You cannot have two classes loaded with the same class name in PHP, so this is kind of pointless.

[eluser]Armorfist[/eluser]
[quote author="wiredesignz" date="1225470183"]
@Armorfist, You cannot have two classes loaded with the same class name in PHP, so this is kind of pointless.[/quote]

Sorry, didn't think about that 8-/

Can you take a look at my previous post? ( http://ellislab.com/forums/viewreply/483045/ )

Thanks

[eluser]wiredesignz[/eluser]
Quote:In MEv4 you had the function fetch_module to get the current module's name, is there something similar available in MEv5?
Code:
$module_name = modules::path(); // name of the last module loaded

Quote:I load a number of language files from various modules in a library. I noticed the load->language() function only loads languages from the module calling it, is there a way (without modifying this function) to load languages from other modules?

Sorry man, cross loading files was recently deprecated in favour of loading from module subdirectories. (re: CI 1.7 compatibility)

application directories can be used to share files between modules.

[eluser]Armorfist[/eluser]
[quote author="wiredesignz" date="1225471692"]

Quote:I load a number of language files from various modules in a library. I noticed the load->language() function only loads languages from the module calling it, is there a way (without modifying this function) to load languages from other modules?

Sorry man, cross loading files was recently deprecated in favour of loading from module subdirectories. (re: CI 1.7 compatibility)

application directories can be used to share files between modules.[/quote]

I modified the "language" function on Controller.php file to accept a third parameter "$module" and it works, but something tells me this breaks something. Can you confirm?

Code:
public function language($langfile, $lang = '',$module = NULL)
    {
        $ci = modules::$registry[$this->_class];
        
        $deft_lang = $ci->config->item('language');
        //Added this line
        $module = ($module == NULL ? $this->_module : $module);
        
        $idiom = ($lang == '') ? $deft_lang : $lang;
    
        if (in_array($langfile.'_lang'.EXT, $ci->lang->is_loaded, TRUE))

            return $ci->lang;
        //Replaced $this->_module by $module
        list($path, $_langfile) = modules::find($idiom.'/'.$langfile.'_lang', $module, 'language/', $this->_class);

[eluser]JasonS[/eluser]
Does this allow a module to be nested within a module?

I am trying to set up the following struction

Admin Module -> User Module -> Controller

If Modular Extensions can do this could you tell me what the directory structure must look like please?

In fact the Module doesn't even need to nested, i just need to group certain modules into a folder called admin. Any ideas on how I would achieve this?

[eluser]tdktank59[/eluser]
[quote author="JasonS" date="1225487466"]Does this allow a module to be nested within a module?

I am trying to set up the following struction

Admin Module -> User Module -> Controller

If Modular Extensions can do this could you tell me what the directory structure must look like please?

In fact the Module doesn't even need to nested, i just need to group certain modules into a folder called admin. Any ideas on how I would achieve this?[/quote]

Im in the same boat as you...

It dosnt seem to work when ive tried it... However I might have been doing it wrong.

I was creating some authentication stuff so my example would be

Auth->login->MVC
Auth->register->MVC

something like that...

[eluser]JasonS[/eluser]
My ideal solution for an admin panel is to have an admin module that reads modules inside it. It would then create a dynamic navigation.

Take the following module structure.

admin
- users
- posts
- pages

The admin controller would generate a view with navigation links to "users | posts | pages". This would allow admin modules to be dropped in the page structure and work right off the bat. This is what I was originally the shooting for.

I also swear that the wiki documentation says that difference between this and matchbox(sp?) is that Modular Extensions allows nested modules. I may have read this wrong though.

Its a shame that I don't fully understand how the url's are created in codeigniter. If I did I would probably be able to make a small modification to this to get it running.

[eluser]Sam Dark[/eluser]
JasonS
You can try to define admin() and menu() methods in each ME controller and execute them to get menus / admin areas.

[eluser]JasonS[/eluser]
[quote author="Sam Dark" date="1225549343"]JasonS
You can try to define admin() and menu() methods in each ME controller and execute them to get menus / admin areas.[/quote]

While this solution would work and might be what I end up doing, I don't like the idea of having to define controllers to point to a specific module. It just all seems a bit counter productive. It also wouldn't allow you to simply drag and drop features on to your website. Instead you would have to add a controller as well..




Theme © iAndrew 2016 - Forum software by © MyBB