-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TO TEST] URL parameters are not taken in to consideration if using default controller/method #213
Comments
Thanks for the commit, I'll test this soon! |
btw the normal way to do this: simply dont use the default method for actions with parameters :) |
Hello @panique thanks for your amazing contribution!!
Is it a way to use the first way and invoke the home controller with the about action?? Thanks in advance! |
@bdiazc90 hi, thanks back! :) does a home controller and an about method exist ? if so, then your apache/nginx settings might be broken, or the installation itself has a problem. I can only recommend to use the autoinstaller and then try to reproduce the error, if you cannot reproduce then it might be your settings... Can you post more details on your problem ? |
Hi @panique! Thanks for your answer, I had been looking for solving my problem in the code. |
Very cool! :) Glad it fixed your problem |
Analysing
application.php
, I see a lot of nestedif
statements, which causes the URL parameters to only be passed tocall_user_func_array()
if the selected controller and method are found, and not if the defaults are used. For example:localhost/mini/home/index/4
sends the parameter4
localhost/mini/home/4
throws an errorlocalhost/mini/4
throws an errorYou'd be better off checking each part of the URL individually, reverting to defaults if need be. Then,
call_user_func_array
will always run. This is my rewrittenapplication.php
:The text was updated successfully, but these errors were encountered: