-
Notifications
You must be signed in to change notification settings - Fork 96
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
Weird behaviour when using controllers #69
Comments
I'd do it this way:
and:
If you want to continue using the controller method, I believe you must ensure that your function has the same parameters. For example:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something that caught me off guard suddenly after many hours of programming:
Routes.php:
$router->controller('/term/config/forms', 'TERM\\FormConfigController');
The specific controller.php file:
`namespace TERM;
class FormConfigController extends \Controller {
public static function getIndex(){
//do something...
}
public static function getActivate($formID){
return A;
}
public static function getEditform($formID, $action = null, $actionValue = null){
return B;
}
`
If I now use the following URL:
some.domain/term/config/forms/editform/20
It results in the getActivate method being called. However, and this is quite peculiar, if I swap getActivate and getEditForm methods around, then it works as expected.
Could someone please explain if this is either a bug, a design flaw from my side, or just a strange way of how this system works?
The text was updated successfully, but these errors were encountered: