Welcome Guest, Not a member yet? Register   Sign In
Problem: HMVC library doesn't manage uri segments
#1

[eluser]Agustín Villalba[/eluser]
Hello,
I'm using HMVC library in codeigniter and I have an url like this:
myserver.com/user/view_users_list/lastname/asc

where:
user = controller (module and controller have the same name)
view_users_list = function in the controller
lastname = first parameter for view_users_list
asc = second parameter for view_users_list

and this is my function:
Code:
function view_users_list($order_by,$dir)
{
...
many code
...
}

When I access to that url I have this errors:

A PHP Error was encountered
Severity: Warning
Message: Missing argument 1 for User::view_users_list(), called in /Applications/XAMPP/xamppfiles/htdocs/plafifob_modules/system/application/modules/user/controllers/user.php on line 667 and defined
Filename: controllers/user.php

A PHP Error was encountered
Severity: Warning
Message: Missing argument 2 for User::view_users_list(), called in /Applications/XAMPP/xamppfiles/htdocs/plafifob_modules/system/application/modules/user/controllers/user.php on line 667 and defined
Filename: controllers/user.php
Line Number: 671

I think that could be some error in the HMVC library, but Am I doing something wrong?

Thank you very much.
#2

[eluser]Andrewgwood[/eluser]
Do you have any custom routes that could be interfering ? I use modules on every project and have never had a problem with the default setup.
#3

[eluser]Agustín Villalba[/eluser]
No, I don't use any route, only this:
$route['default_controller'] = "user";

But it is in application/config/config.php file.

I don't think that it is a routes problem.

Any idea?

Thanks!
#4

[eluser]Federico Baña[/eluser]
Why dont you try using $this->uri->segment() instead?
#5

[eluser]Agustín Villalba[/eluser]
That's the solution I have found, but I think it is not an elegant solution. I think it shuold work without using $this->uri->segment().

Does any body know how to fix it?

Thanks!
#6

[eluser]Andrewgwood[/eluser]
does the same problem exist if you goto
myserver.com/user/user/view_users_list/lastname/asc

I will look into a project I'm working on, perhaps I had to hack at something a while back to get this working properly. I know that I do have this feature working as expected even using Modules::run(); I can pass
the params through.

I'll post back shortly




Theme © iAndrew 2016 - Forum software by © MyBB