Welcome Guest, Not a member yet? Register   Sign In
[modules] Matchbox not working as it should! Help me pls!! - NOT SOLVED YET
#1

[eluser]Buso[/eluser]
I would like to access to a module 'comments', controller 'comments', function 'index', and send a value of say, '2'.

Currently, the only way I can access there is with this url:

http://mydomain.com/comments/comments/index/2


I would like to change it to something like:

http://declaratele/comments/2


Is that possible? I have been trying many different ways but it doesn't work.

ps: Im using matchbox
#2

[eluser]thdls55[/eluser]
Hi Buso,

you should put something like this:

Code:
$route['comments/(:num)'] = "comments/comments/index/$1";

in the application/config/routes.php file
#3

[eluser]Buso[/eluser]
[quote author="thdls55" date="1257911942"]Hi Buso,

you should put something like this:

Code:
$route['comments/(:num)'] = "comments/comments/index/$1";

in the application/config/routes.php file[/quote]

thanks i will try it
#4

[eluser]Phil Sturgeon[/eluser]
What the hell module system makes you do that? I have used all of the popular ones around (every one that I have ever seen on the forums) and none of them make you do comments/comments.

Update: Ok just spotted the P.S. If Matchbox is REALLY forcing you to double up on the module name and controller name, something is broken.

Make sure you have the newest version.
#5

[eluser]Buso[/eluser]
[quote author="Phil Sturgeon" date="1257970599"]What the hell module system makes you do that? I have used all of the popular ones around (every one that I have ever seen on the forums) and none of them make you do comments/comments.

Update: Ok just spotted the P.S. If Matchbox is REALLY forcing you to double up on the module name and controller name, something is broken.

Make sure you have the newest version.[/quote]
Im not sure that something is broken, for example this one works:

Code:
mydomain.com/users

But this one doesn't, and Im not sure if it is supposed to:

Code:
mydomain.com/users/login
(login is a function, from the controller users.. users is also a module of course)
It works if I make a new controller called login. I wouldn't have opened a thread if I knew that, but now that I have I go and ask this:

If I have to make a controller for every function that is gonna be used in a url, that would be too much separation =/ (but maybe that's the way to go about it?)
#6

[eluser]Phil Sturgeon[/eluser]
Something is going wrong for sure. The whole point of having the main controller the same name as the module is that you can use the one URL segment for both.

Do you have any strange routes?
#7

[eluser]Buso[/eluser]
[quote author="Phil Sturgeon" date="1258053780"]Something is going wrong for sure. The whole point of having the main controller the same name as the module is that you can use the one URL segment for both.

Do you have any strange routes?[/quote]
no

could it be the htaccess?

Code:
RewriteEngine On
RewriteBase /
RewriteRule ^(system|application|cgi-bin) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [L]
#8

[eluser]Buso[/eluser]
I have reinstalled everything:

-downloaded matchbox
-downloaded CI
-installed CI
-installed matchbox
-set up config and database.php
-set up routes (only the default controller and scaffolding trigger. No strange routes)
-set up the htaccess (The same as the one in the userguide, only to remove index.php)
-dropped my modules inside application/modules/ (only 3 modules: blog, comments, users. No, I didn't overwrite the matchbox module)
-dropped MY_Form_validation.php inside application/libraries/ (only 1 function: _nick_validation )
-dropped some language folders in system/language/

mydomain.com/module/controller/function -> WORKS
mydomain.com/controller/function -> DOESN'T WORK

(of course module and controller have the same name)

Any ideas ?????????????????????????????????
#9

[eluser]zdknudsen[/eluser]
Try zipping and uploading that fresh installation of yours and let me have a look at it.
#10

[eluser]CI flea[/eluser]
[quote author="Buso" date="1258001983"][quote author="Phil Sturgeon" date="1257970599"]What the hell module system makes you do that? I have used all of the popular ones around (every one that I have ever seen on the forums) and none of them make you do comments/comments.

Update: Ok just spotted the P.S. If Matchbox is REALLY forcing you to double up on the module name and controller name, something is broken.

Make sure you have the newest version.[/quote]
Im not sure that something is broken, for example this one works:

Code:
mydomain.com/users

But this one doesn't, and Im not sure if it is supposed to:

Code:
mydomain.com/users/login
(login is a function, from the controller users.. users is also a module of course)
It works if I make a new controller called login. I wouldn't have opened a thread if I knew that, but now that I have I go and ask this:

If I have to make a controller for every function that is gonna be used in a url, that would be too much separation =/ (but maybe that's the way to go about it?)[/quote]

Had the same problem. This comment fixed it (http://ellislab.com/forums/viewreply/643129/), but now I have other problems.

best of luck




Theme © iAndrew 2016 - Forum software by © MyBB