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

[eluser]Paul Apostol[/eluser]
Hello,
There is any way to recover the name of the module?
rsegment_array() returns only the controller/function
Thank you

EDIT:
I always love self answers (tested in CI 1.7.0):
In My_Router class I added
Code:
var $module = '';
function set_module($module)
{
    $this->module = $module;
}
function fetch_module()
{
    return $this->module;
}
At the end of _validate_request, just before the return
Code:
$this->set_module($module);

Now, if you get access to CI instance: $this->CI =& get_instance();
you can get the module by: $this->CI->router->fetch_module();

[eluser]krasnik[/eluser]
I have a problem with this HMVC Lib. Maybe this is answered before but i couldn't find it.

I have an admin controller (for backend) with loads admin functions from another controller, lets say the gallery. now i want to use the same helper functions i use if i call the gallery controller directly (for frontend). This does not work. i got an error like this:
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Admin::$gallery_model

Filename: helpers/gallery_helper.php

Line Number: 58

Fatal error: Call to a member function get_pictures() on a non-object in /mnt/***/application/modules/gallery/helpers/gallery_helper.php on line 58

The helper calls a model function from the same module. If i call the model function directly from the admin function of the called controller it works.

what's the problem here?

Thanks!

[eluser]krasnik[/eluser]
Hmm no one?

i would think it's a basic php problem that i don't understand.

thank you for help Wink

[eluser]err403_love[/eluser]
I was curious why this triples the page generation time of the default CI install.

"Page rendered in 0.0953 seconds" vs "Page rendered in 0.2754 seconds"

I think that this starts to border on making this library not worth it... :/ I've used this for several different projects that I've toyed with, but now that I'm actually developing an application for somebody I don't want to use this if it's going to affect performance so greatly.

I'm curious, are there any optimizations that can be made for specific setups? As in maybe optimizing the "find()" function for my own conventions. IE not actually having it search at all, but know the exact location based on my conventions.

[eluser]Kopel[/eluser]
Hi,

The HMVC concept is pretty new to me.
So far, i love the way i can break the code into reusable modules.

I'm trying to find a way to isolate form validation of each modules.

I want to be able to load several modules with forms on the same page.
When i submit one of theses forms: only the rules of the submitted form should be checked, not all the rules of all the forms of the page.

How can i do that?

[eluser]dcunited08[/eluser]
[quote author="krasnik" date="1232307706"]I have a problem with this HMVC Lib. Maybe this is answered before but i couldn't find it.

I have an admin controller (for backend) with loads admin functions from another controller, lets say the gallery. now i want to use the same helper functions i use if i call the gallery controller directly (for frontend). This does not work. i got an error like this:
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Admin::$gallery_model

Filename: helpers/gallery_helper.php

Line Number: 58

Fatal error: Call to a member function get_pictures() on a non-object in /mnt/***/application/modules/gallery/helpers/gallery_helper.php on line 58

The helper calls a model function from the same module. If i call the model function directly from the admin function of the called controller it works.

what's the problem here?

Thanks![/quote]

I may be wrong about how you have things set up but, if I understand you correctly, you are trying to call a module from within a helper function? This is, at the very least unorthodox. Can you please give us the code within the helper function?

[eluser]Gnative[/eluser]
you can use in your helper

$MOD =& modules::$registry['module_name'];

[eluser]Michel-Ange[/eluser]
To come again back with an old question : it is planned to permit the use of application/controllers subfolders ?
For example, if you wish to use an admin section located in application/controllers/admin, it's currently not possible with ME.

[eluser]Armorfist[/eluser]
[quote author="Michel-Ange" date="1239824653"]To come again back with an old question : it is planned to permit the use of application/controllers subfolders ?
For example, if you wish to use an admin section located in application/controllers/admin, it's currently not possible with ME.[/quote]

I think it is possible. I don't remember if i made modifications tho, but I don't think so

*EDIT*

I was confusing with MatchBox. It is NOT possible. I remember now i had to change the folder structure because of this!

[eluser]easylancer[/eluser]
[quote author="Armorfist" date="1239824986"][quote author="Michel-Ange" date="1239824653"]To come again back with an old question : it is planned to permit the use of application/controllers subfolders ?
For example, if you wish to use an admin section located in application/controllers/admin, it's currently not possible with ME.[/quote]

I think it is possible. I don't remember if i made modifications tho, but I don't think so

*EDIT*

I was confusing with MatchBox. It is NOT possible. I remember now i had to change the folder structure because of this![/quote]

This is very much so possible, I have done it to my version of ME, when I get the time I will post it on here for all to see. But I think my ME has been deeply modified so I will have to do it with a new install of ME.




Theme © iAndrew 2016 - Forum software by © MyBB